Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __DISPATCH_BASE__
00022 #define __DISPATCH_BASE__
00023
00024 #ifndef __DISPATCH_INDIRECT__
00025 #error "Please #include <dispatch/dispatch.h> instead of this file directly."
00026 #endif
00027
00028 #if defined(__cplusplus) && !defined(_MSC_VER)
00029
00030
00031
00032
00033 typedef struct dispatch_object_s {
00034 private:
00035 dispatch_object_s();
00036 ~dispatch_object_s();
00037 dispatch_object_s(const dispatch_object_s &);
00038 void operator=(const dispatch_object_s &);
00039 } *dispatch_object_t;
00040 #else
00041 # ifdef __GNUC__
00042 typedef union {
00043 struct dispatch_object_s *_do;
00044 struct dispatch_continuation_s *_dc;
00045 struct dispatch_queue_s *_dq;
00046 struct dispatch_queue_attr_s *_dqa;
00047 struct dispatch_group_s *_dg;
00048 struct dispatch_source_s *_ds;
00049 struct dispatch_source_attr_s *_dsa;
00050 struct dispatch_semaphore_s *_dsema;
00051 } dispatch_object_t __attribute__((transparent_union));
00052 # else
00053
00054
00055 struct dispatch_object_s;
00056 typedef void* dispatch_object_t;
00057 #endif
00058 #endif
00059
00060 typedef void (*dispatch_function_t)(void *);
00061
00062 #if defined(__cplusplus) && !defined(_MSC_VER)
00063 #define DISPATCH_DECL(name) typedef struct name##_s : public dispatch_object_s {} *name##_t
00064 #else
00065
00066 #define DISPATCH_DECL(name) typedef struct name##_s *name##_t
00067 #endif
00068
00069 #ifdef __GNUC__
00070 # ifndef DISPATCH_NORETURN
00071 # define DISPATCH_NORETURN __attribute__((__noreturn__))
00072 # endif
00073 # define DISPATCH_NOTHROW __attribute__((__nothrow__))
00074 # define DISPATCH_NONNULL1 __attribute__((__nonnull__(1)))
00075 # define DISPATCH_NONNULL2 __attribute__((__nonnull__(2)))
00076 # define DISPATCH_NONNULL3 __attribute__((__nonnull__(3)))
00077 # define DISPATCH_NONNULL4 __attribute__((__nonnull__(4)))
00078 # define DISPATCH_NONNULL5 __attribute__((__nonnull__(5)))
00079 # define DISPATCH_NONNULL6 __attribute__((__nonnull__(6)))
00080 # define DISPATCH_NONNULL7 __attribute__((__nonnull__(7)))
00081 # if __clang__
00082
00083 # define DISPATCH_NONNULL_ALL
00084 # else
00085 # define DISPATCH_NONNULL_ALL __attribute__((__nonnull__))
00086 # endif
00087 # define DISPATCH_SENTINEL __attribute__((__sentinel__))
00088 # define DISPATCH_PURE __attribute__((__pure__))
00089 # define DISPATCH_WARN_RESULT __attribute__((__warn_unused_result__))
00090 # define DISPATCH_MALLOC __attribute__((__malloc__))
00091 # define DISPATCH_FORMAT(...) __attribute__((__format__(__VA_ARGS__)))
00092 #else
00093
00094 # define DISPATCH_NORETURN
00095
00096 # define DISPATCH_NOTHROW
00097
00098 # define DISPATCH_NONNULL1
00099
00100 # define DISPATCH_NONNULL2
00101
00102 # define DISPATCH_NONNULL3
00103
00104 # define DISPATCH_NONNULL4
00105
00106 # define DISPATCH_NONNULL5
00107
00108 # define DISPATCH_NONNULL6
00109
00110 # define DISPATCH_NONNULL7
00111
00112 # define DISPATCH_NONNULL_ALL
00113
00114 # define DISPATCH_SENTINEL
00115
00116 # define DISPATCH_PURE
00117
00118 # define DISPATCH_WARN_RESULT
00119
00120 # define DISPATCH_MALLOC
00121
00122 # define DISPATCH_FORMAT(...)
00123 #endif
00124
00125 #ifndef DISPATCH_EXPORT
00126 # ifdef _WIN32
00127 # ifdef DISPATCH_MAKEDLL
00128 # define DISPATCH_EXPORT __declspec(dllexport)
00129 # else
00130 # define DISPATCH_EXPORT __declspec(dllimport)
00131 # endif
00132 # else
00133 # define DISPATCH_EXPORT __attribute__((visibility("default")))
00134 # endif
00135 #endif
00136
00137 #ifndef DISPATCH_EXTERN
00138 # ifdef _WIN32
00139 # define DISPATCH_EXTERN
00140 # else
00141 # define DISPATCH_EXTERN extern
00142 # endif
00143 #endif
00144
00145 #ifndef DISPATCH_PTR
00146 # ifdef _WIN32
00147 # define DISPATCH_PTR *
00148 # else
00149 # define DISPATCH_PTR
00150 # endif
00151 #endif
00152
00153 #ifndef __OSX_AVAILABLE_STARTING
00154 # define __OSX_AVAILABLE_STARTING(...)
00155 #endif
00156
00157 #endif
00158