1#ifndef INCLUDED_OOFUNCTIONATTRIBUTES_h
2#define INCLUDED_OOFUNCTIONATTRIBUTES_h
7 #define GCC_ATTR(x) __attribute__(x)
16 #define __has_feature(x) (0)
19#ifndef __has_attribute
20 #define __has_attribute(x) (0)
23#ifndef __has_extension
24 #define __has_extension(x) (0)
29#define OOINLINE inline
31#define OOINLINE static inline
36#define ALWAYS_INLINE_FUNC GCC_ATTR((always_inline))
38#define ALWAYS_INLINE_FUNC
41#define PURE_FUNC GCC_ATTR((pure))
42#define CONST_FUNC GCC_ATTR((const))
43#define NONNULL_FUNC GCC_ATTR((nonnull))
44#define DEPRECATED_FUNC GCC_ATTR((deprecated))
45#define NO_RETURN_FUNC GCC_ATTR((noreturn))
46#define NO_INLINE_FUNC GCC_ATTR((noinline))
48#define INLINE_PURE_FUNC ALWAYS_INLINE_FUNC PURE_FUNC
49#define INLINE_CONST_FUNC ALWAYS_INLINE_FUNC CONST_FUNC
52#if __has_extension(attribute_deprecated_with_message)
53#define DEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
55#define DEPRECATED_MSG(msg) DEPRECATED_FUNC
60#define DEPRECATED_METHOD(msg) DEPRECATED_MSG(msg)
63#define DEPRECATED_METHOD(msg)
68 #define EXPECT(x) __builtin_expect((x), 1)
69 #define EXPECT_NOT(x) __builtin_expect((x), 0)
72 #define EXPECT_NOT(x) (x)
77#if __has_feature(attribute_ns_returns_retained)
78 #define OO_RETURNS_RETAINED __attribute__((ns_returns_retained))
80 #define OO_RETURNS_RETAINED
85#if __has_feature(attribute_ns_consumed)
86#define OO_NS_CONSUMED __attribute__((ns_consumed))
93#if __has_feature(__builtin_unreachable)
94 #define OO_UNREACHABLE() __builtin_unreachable()
96 #define OO_UNREACHABLE() do {} while (0)
111#if __has_attribute(format)
112 #define OO_TAKES_FORMAT_STRING(stringIndex, firstToCheck) __attribute__((format(NSString, stringIndex, firstToCheck)))
114 #define OO_TAKES_FORMAT_STRING(stringIndex, firstToCheck)
id OOConsumeReference(id OO_NS_CONSUMED value)
#define ALWAYS_INLINE_FUNC