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
00022
00023
00024
00025
00026
00027
00028 #ifndef XDISPATCH_LAMBDA_BLOCKS_H_
00029 #define XDISPATCH_LAMBDA_BLOCKS_H_
00030
00036 #ifndef __XDISPATCH_INDIRECT__
00037 #error "Please #include <xdispatch/dispatch.h> instead of this file directly."
00038 #endif
00039
00096 #ifndef XDISPATCH_DOXYGEN_RUN
00097
00098
00099 #ifdef __BLOCKS__
00100 # include <Block.h>
00101 # include <stddef.h>
00102 # define XDISPATCH_BLOCK ^
00103 # ifndef XDISPATCH_NO_KEYWORDS
00104 # define $ ^
00105 # endif // XDISPATCH_NO_KEYWORDS
00106
00107 typedef void (^dispatch_iteration_block_t)(size_t);
00108 # define XDISPATCH_HAS_BLOCKS 1
00109 # if defined(__cplusplus) && !defined(__clang__)
00110 # warning "Sadly blocks are currently broken in C++ on this platform, we recommend using gcc 4.5.1 or clang 2.0 instead"
00111 # endif
00112 #endif // __BLOCKS__
00113
00114
00115 #if _MSC_VER >= 1600
00116
00117 # include <functional>
00118 # define XDISPATCH_BLOCK [=]
00119 # ifndef XDISPATCH_NO_KEYWORDS
00120 # define $ [=]
00121 # endif
00122
00123 __XDISPATCH_BEGIN_NAMESPACE
00124 typedef ::std::tr1::function< void (void) > lambda_function;
00125 typedef ::std::tr1::function< void (size_t) > iteration_lambda_function;
00126 __XDISPATCH_END_NAMESPACE
00127
00128 # define XDISPATCH_HAS_LAMBDAS 1
00129 # define XDISPATCH_HAS_FUNCTION 1
00130
00131
00132 #elif _MSC_VER >= 1500
00133
00134 # include <functional>
00135
00136 __XDISPATCH_BEGIN_NAMESPACE
00137 typedef ::std::tr1::function< void (void) > lambda_function;
00138 typedef ::std::tr1::function< void (size_t) > iteration_lambda_function;
00139 __XDISPATCH_END_NAMESPACE
00140
00141 # define XDISPATCH_HAS_FUNCTION 1
00142
00143
00144 #elif defined(__GNUC__) || defined(__clang__)
00145
00146
00147 # if defined(__GXX_EXPERIMENTAL_CXX0X__)
00148 # ifndef XDISPATCH_HAS_BLOCKS
00149 # define XDISPATCH_BLOCK [=]
00150 # ifndef XDISPATCH_NO_KEYWORDS
00151 # define $ [=]
00152 # endif // XDISPATCH_NO_KEYWORDS
00153 # endif // XDISPATCH_HAS_BLOCKS
00154 # define XDISPATCH_HAS_LAMBDAS 1
00155 # endif // __GXX_EXPERIMENTAL_CXX0X__
00156
00157 # include <tr1/functional>
00158
00159 __XDISPATCH_BEGIN_NAMESPACE
00160 typedef ::std::tr1::function< void (void) > lambda_function;
00161 typedef ::std::tr1::function< void (size_t) > iteration_lambda_function;
00162 __XDISPATCH_END_NAMESPACE
00163
00164 # define XDISPATCH_HAS_FUNCTION 1
00165
00166 #else
00167
00168 # error "Unsupported compiler version"
00169
00170 #endif
00171
00172 #endif
00173
00174 #ifdef XDISPATCH_DOXYGEN_RUN
00175 # define $ [=]
00176 #endif
00177
00180 #endif