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
00029 #ifndef __DISPATCH_INDIRECT__
00030 #error "Please #include <dispatch/dispatch.h> instead of this file directly."
00031 #endif
00032
00033 #if defined(__cplusplus) && !defined(_MSC_VER)
00034
00035
00036
00037
00038 typedef struct dispatch_object_s {
00039 private:
00040 dispatch_object_s();
00041 ~dispatch_object_s();
00042 dispatch_object_s(const dispatch_object_s &);
00043 void operator=(const dispatch_object_s &);
00044 } *dispatch_object_t;
00045 #else
00046 # ifdef __GNUC__
00047 typedef union {
00048 struct dispatch_object_s *_do;
00049 struct dispatch_continuation_s *_dc;
00050 struct dispatch_queue_s *_dq;
00051 struct dispatch_queue_attr_s *_dqa;
00052 struct dispatch_group_s *_dg;
00053 struct dispatch_source_s *_ds;
00054 struct dispatch_source_attr_s *_dsa;
00055 struct dispatch_semaphore_s *_dsema;
00056 } dispatch_object_t __attribute__((transparent_union));
00057 # else
00058
00059
00060 struct dispatch_object_s;
00061 typedef void* dispatch_object_t;
00062 #endif
00063 #endif
00064
00065 typedef void (*dispatch_function_t)(void *);
00066
00067 #if defined(__cplusplus) && !defined(_MSC_VER)
00068 #define DISPATCH_DECL(name) typedef struct name##_s : public dispatch_object_s {} *name##_t
00069 #else
00070
00071 #define DISPATCH_DECL(name) typedef struct name##_s *name##_t
00072 #endif
00073
00074 #ifndef DISPATCH_EXPORT
00075 # ifdef _WIN32
00076 # ifdef DISPATCH_MAKEDLL
00077 # define DISPATCH_EXPORT __declspec(dllexport)
00078 # else
00079 # define DISPATCH_EXPORT __declspec(dllimport)
00080 # endif
00081 # else
00082 # define DISPATCH_EXPORT __attribute__((visibility("default")))
00083 # endif
00084 #endif
00085
00086 #ifndef DISPATCH_EXTERN
00087 # ifdef _WIN32
00088 # define DISPATCH_EXTERN
00089 # else
00090 # define DISPATCH_EXTERN extern
00091 # endif
00092 #endif
00093
00094
00097 #endif
00098