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
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00047 #ifndef PLATFORMSTL_INCL_PLATFORMSTL_SYNCH_H_ATOMIC_FUNCTIONS
00048 #define PLATFORMSTL_INCL_PLATFORMSTL_SYNCH_H_ATOMIC_FUNCTIONS
00049
00050 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00051 # define PLATFORMSTL_VER_PLATFORMSTL_SYNCH_H_ATOMIC_FUNCTIONS_MAJOR 2
00052 # define PLATFORMSTL_VER_PLATFORMSTL_SYNCH_H_ATOMIC_FUNCTIONS_MINOR 3
00053 # define PLATFORMSTL_VER_PLATFORMSTL_SYNCH_H_ATOMIC_FUNCTIONS_REVISION 2
00054 # define PLATFORMSTL_VER_PLATFORMSTL_SYNCH_H_ATOMIC_FUNCTIONS_EDIT 29
00055 #endif
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071 #ifndef PLATFORMSTL_INCL_PLATFORMSTL_H_PLATFORMSTL
00072 # include <platformstl/platformstl.h>
00073 #endif
00074 #ifndef PLATFORMSTL_INCL_PLATFORMSTL_SYNCH_H_ATOMIC_TYPES
00075 # include <platformstl/synch/atomic_types.h>
00076 #endif
00077
00078 #if defined(PLATFORMSTL_OS_IS_UNIX)
00079 # ifndef UNIXSTL_INCL_UNIXSTL_SYNCH_H_ATOMIC_FUNCTIONS
00080 # include <unixstl/synch/atomic_functions.h>
00081 # endif
00082 #elif defined(PLATFORMSTL_OS_IS_WINDOWS)
00083 # ifndef WINSTL_INCL_WINSTL_SYNCH_H_ATOMIC_FUNCTIONS
00084 # include <winstl/synch/atomic_functions.h>
00085 # endif
00086 #else
00087 # error Operating system not discriminated
00088 #endif
00089
00090
00091
00092
00093
00094 #if !defined(__cplusplus)
00095
00096 #elif defined(_STLSOFT_NO_NAMESPACE) || \
00097 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00098
00099 namespace platformstl
00100 {
00101 #else
00102
00103
00104 namespace stlsoft
00105 {
00106
00107 namespace platformstl_project
00108 {
00109 #endif
00110
00111
00112
00113
00114
00115 #ifdef PLATFORMSTL_HAS_ATOMIC_PREINCREMENT
00116 # undef PLATFORMSTL_HAS_ATOMIC_PREINCREMENT
00117 #endif
00118 #ifdef PLATFORMSTL_HAS_ATOMIC_PREDECREMENT
00119 # undef PLATFORMSTL_HAS_ATOMIC_PREDECREMENT
00120 #endif
00121 #ifdef PLATFORMSTL_HAS_ATOMIC_POSTINCREMENT
00122 # undef PLATFORMSTL_HAS_ATOMIC_POSTINCREMENT
00123 #endif
00124 #ifdef PLATFORMSTL_HAS_ATOMIC_POSTDECREMENT
00125 # undef PLATFORMSTL_HAS_ATOMIC_POSTDECREMENT
00126 #endif
00127 #ifdef PLATFORMSTL_HAS_ATOMIC_INCREMENT
00128 # undef PLATFORMSTL_HAS_ATOMIC_INCREMENT
00129 #endif
00130 #ifdef PLATFORMSTL_HAS_ATOMIC_DECREMENT
00131 # undef PLATFORMSTL_HAS_ATOMIC_DECREMENT
00132 #endif
00133 #ifdef PLATFORMSTL_HAS_ATOMIC_READ
00134 # undef PLATFORMSTL_HAS_ATOMIC_READ
00135 #endif
00136 #ifdef PLATFORMSTL_HAS_ATOMIC_WRITE
00137 # undef PLATFORMSTL_HAS_ATOMIC_WRITE
00138 #endif
00139 #ifdef PLATFORMSTL_HAS_ATOMIC_PREADD
00140 # undef PLATFORMSTL_HAS_ATOMIC_PREADD
00141 #endif
00142 #ifdef PLATFORMSTL_HAS_ATOMIC_POSTADD
00143 # undef PLATFORMSTL_HAS_ATOMIC_POSTADD
00144 #endif
00145
00146
00147
00148 #if defined(__cplusplus)
00149
00150 # ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00151 namespace implementation
00152 {
00153 # endif
00154 # if defined(PLATFORMSTL_OS_IS_UNIX)
00155
00156 # ifndef PLATFORSL_DEFINED_platform_stl_
00157 # define PLATFORSL_DEFINED_platform_stl_
00158 namespace platform_stl_ = ::unixstl;
00159 # endif
00160
00161 # elif defined(PLATFORMSTL_OS_IS_WINDOWS)
00162
00163 # ifndef PLATFORSL_DEFINED_platform_stl_
00164 # define PLATFORSL_DEFINED_platform_stl_
00165 namespace platform_stl_ = ::winstl;
00166 # endif
00167
00168 # else
00169 # error Operating system not discriminated
00170 # endif
00171 # ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00172 }
00173 # endif
00174
00175 # if ( defined(PLATFORMSTL_OS_IS_UNIX) && \
00176 defined(_UNIXSTL_NO_NAMESPACE)) || \
00177 ( defined(PLATFORMSTL_OS_IS_WINDOWS) && \
00178 defined(_WINSTL_NO_NAMESPACE))
00179
00180
00181 # if defined(PLATFORMSTL_OS_IS_UNIX)
00182
00183 # ifdef UNIXSTL_HAS_ATOMIC_PREINCREMENT
00184 using atomic_preincrement;
00185 # define PLATFORMSTL_HAS_ATOMIC_PREINCREMENT
00186 # endif
00187 # ifdef UNIXSTL_HAS_ATOMIC_PREDECREMENT
00188 using atomic_predecrement;
00189 # define PLATFORMSTL_HAS_ATOMIC_PREDECREMENT
00190 # endif
00191 # ifdef UNIXSTL_HAS_ATOMIC_POSTINCREMENT
00192 using atomic_postincrement;
00193 # define PLATFORMSTL_HAS_ATOMIC_POSTINCREMENT
00194 # endif
00195 # ifdef UNIXSTL_HAS_ATOMIC_POSTDECREMENT
00196 using atomic_postdecrement;
00197 # define PLATFORMSTL_HAS_ATOMIC_POSTDECREMENT
00198 # endif
00199 # ifdef UNIXSTL_HAS_ATOMIC_INCREMENT
00200 using atomic_increment;
00201 # define PLATFORMSTL_HAS_ATOMIC_INCREMENT
00202 # endif
00203 # ifdef UNIXSTL_HAS_ATOMIC_DECREMENT
00204 using atomic_decrement;
00205 # define PLATFORMSTL_HAS_ATOMIC_DECREMENT
00206 # endif
00207 # ifdef UNIXSTL_HAS_ATOMIC_READ
00208 using atomic_read;
00209 # define PLATFORMSTL_HAS_ATOMIC_READ
00210 # endif
00211 # ifdef UNIXSTL_HAS_ATOMIC_WRITE
00212 using atomic_write;
00213 # define PLATFORMSTL_HAS_ATOMIC_WRITE
00214 # endif
00215 # ifdef UNIXSTL_HAS_ATOMIC_PREADD
00216 using atomic_preadd;
00217 # define PLATFORMSTL_HAS_ATOMIC_PREADD
00218 # endif
00219 # ifdef UNIXSTL_HAS_ATOMIC_POSTADD
00220 using atomic_postadd;
00221 # define PLATFORMSTL_HAS_ATOMIC_POSTADD
00222 # endif
00223
00224 # elif defined(PLATFORMSTL_OS_IS_WINDOWS)
00225
00226 # if defined(UNIXSTL_ARCH_IS_X86) || \
00227 defined(UNIXSTL_ARCH_IS_IA64) || \
00228 defined(UNIXSTL_ARCH_IS_X64)
00229
00230 using atomic_preincrement_up;
00231 using atomic_predecrement_up;
00232 using atomic_postincrement_up;
00233 using atomic_postdecrement_up;
00234 using atomic_increment_up;
00235 using atomic_decrement_up;
00236 using atomic_write_up;
00237 using atomic_read_up;
00238 using atomic_postadd_up;
00239 using atomic_preadd_up;
00240 using atomic_preincrement_smp;
00241 using atomic_predecrement_smp;
00242 using atomic_postincrement_smp;
00243 using atomic_postdecrement_smp;
00244 using atomic_increment_smp;
00245 using atomic_decrement_smp;
00246 using atomic_write_smp;
00247 using atomic_read_smp;
00248 using atomic_postadd_smp;
00249 using atomic_preadd_smp;
00250 using atomic_preincrement;
00251 using atomic_predecrement;
00252 using atomic_postincrement;
00253 using atomic_postdecrement;
00254 using atomic_increment;
00255 using atomic_decrement;
00256 using atomic_write;
00257 using atomic_read;
00258 using atomic_postadd;
00259 using atomic_preadd;
00260
00261 # define PLATFORMSTL_HAS_ATOMIC_PREINCREMENT
00262 # define PLATFORMSTL_HAS_ATOMIC_PREDECREMENT
00263 # define PLATFORMSTL_HAS_ATOMIC_POSTINCREMENT
00264 # define PLATFORMSTL_HAS_ATOMIC_POSTDECREMENT
00265 # define PLATFORMSTL_HAS_ATOMIC_INCREMENT
00266 # define PLATFORMSTL_HAS_ATOMIC_DECREMENT
00267 # define PLATFORMSTL_HAS_ATOMIC_READ
00268 # define PLATFORMSTL_HAS_ATOMIC_WRITE
00269 # define PLATFORMSTL_HAS_ATOMIC_PREADD
00270 # define PLATFORMSTL_HAS_ATOMIC_POSTADD
00271
00272 # else
00273 # error Not valid for processors other than Intel
00274 # endif
00275 # else
00276 # error Operating system not discriminated
00277 # endif
00278 # else
00279
00280
00281 # if defined(PLATFORMSTL_OS_IS_UNIX)
00282
00283 # ifdef UNIXSTL_HAS_ATOMIC_PREINCREMENT
00284 using implementation::platform_stl_::atomic_preincrement;
00285 # define PLATFORMSTL_HAS_ATOMIC_PREINCREMENT
00286 # endif
00287 # ifdef UNIXSTL_HAS_ATOMIC_PREDECREMENT
00288 using implementation::platform_stl_::atomic_predecrement;
00289 # define PLATFORMSTL_HAS_ATOMIC_PREDECREMENT
00290 # endif
00291 # ifdef UNIXSTL_HAS_ATOMIC_POSTINCREMENT
00292 using implementation::platform_stl_::atomic_postincrement;
00293 # define PLATFORMSTL_HAS_ATOMIC_POSTINCREMENT
00294 # endif
00295 # ifdef UNIXSTL_HAS_ATOMIC_POSTDECREMENT
00296 using implementation::platform_stl_::atomic_postdecrement;
00297 # define PLATFORMSTL_HAS_ATOMIC_POSTDECREMENT
00298 # endif
00299 # ifdef UNIXSTL_HAS_ATOMIC_INCREMENT
00300 using implementation::platform_stl_::atomic_increment;
00301 # define PLATFORMSTL_HAS_ATOMIC_INCREMENT
00302 # endif
00303 # ifdef UNIXSTL_HAS_ATOMIC_DECREMENT
00304 using implementation::platform_stl_::atomic_decrement;
00305 # define PLATFORMSTL_HAS_ATOMIC_DECREMENT
00306 # endif
00307 # ifdef UNIXSTL_HAS_ATOMIC_READ
00308 using implementation::platform_stl_::atomic_read;
00309 # define PLATFORMSTL_HAS_ATOMIC_READ
00310 # endif
00311 # ifdef UNIXSTL_HAS_ATOMIC_WRITE
00312 using implementation::platform_stl_::atomic_write;
00313 # define PLATFORMSTL_HAS_ATOMIC_WRITE
00314 # endif
00315 # ifdef UNIXSTL_HAS_ATOMIC_PREADD
00316 using implementation::platform_stl_::atomic_preadd;
00317 # define PLATFORMSTL_HAS_ATOMIC_PREADD
00318 # endif
00319 # ifdef UNIXSTL_HAS_ATOMIC_POSTADD
00320 using implementation::platform_stl_::atomic_postadd;
00321 # define PLATFORMSTL_HAS_ATOMIC_POSTADD
00322 # endif
00323
00324 # elif defined(PLATFORMSTL_OS_IS_WINDOWS)
00325
00326 # if defined(WINSTL_ARCH_IS_X86) || \
00327 defined(WINSTL_ARCH_IS_IA64) || \
00328 defined(WINSTL_ARCH_IS_X64)
00329
00330 using implementation::platform_stl_::atomic_preincrement_up;
00331 using implementation::platform_stl_::atomic_predecrement_up;
00332 using implementation::platform_stl_::atomic_postincrement_up;
00333 using implementation::platform_stl_::atomic_postdecrement_up;
00334 using implementation::platform_stl_::atomic_increment_up;
00335 using implementation::platform_stl_::atomic_decrement_up;
00336 using implementation::platform_stl_::atomic_write_up;
00337 using implementation::platform_stl_::atomic_read_up;
00338 using implementation::platform_stl_::atomic_postadd_up;
00339 using implementation::platform_stl_::atomic_preadd_up;
00340 using implementation::platform_stl_::atomic_preincrement_smp;
00341 using implementation::platform_stl_::atomic_predecrement_smp;
00342 using implementation::platform_stl_::atomic_postincrement_smp;
00343 using implementation::platform_stl_::atomic_postdecrement_smp;
00344 using implementation::platform_stl_::atomic_increment_smp;
00345 using implementation::platform_stl_::atomic_decrement_smp;
00346 using implementation::platform_stl_::atomic_write_smp;
00347 using implementation::platform_stl_::atomic_read_smp;
00348 using implementation::platform_stl_::atomic_postadd_smp;
00349 using implementation::platform_stl_::atomic_preadd_smp;
00350 using implementation::platform_stl_::atomic_preincrement;
00351 using implementation::platform_stl_::atomic_predecrement;
00352 using implementation::platform_stl_::atomic_postincrement;
00353 using implementation::platform_stl_::atomic_postdecrement;
00354 using implementation::platform_stl_::atomic_increment;
00355 using implementation::platform_stl_::atomic_decrement;
00356 using implementation::platform_stl_::atomic_write;
00357 using implementation::platform_stl_::atomic_read;
00358 using implementation::platform_stl_::atomic_postadd;
00359 using implementation::platform_stl_::atomic_preadd;
00360
00361 # define PLATFORMSTL_HAS_ATOMIC_PREINCREMENT
00362 # define PLATFORMSTL_HAS_ATOMIC_PREDECREMENT
00363 # define PLATFORMSTL_HAS_ATOMIC_POSTINCREMENT
00364 # define PLATFORMSTL_HAS_ATOMIC_POSTDECREMENT
00365 # define PLATFORMSTL_HAS_ATOMIC_INCREMENT
00366 # define PLATFORMSTL_HAS_ATOMIC_DECREMENT
00367 # define PLATFORMSTL_HAS_ATOMIC_READ
00368 # define PLATFORMSTL_HAS_ATOMIC_WRITE
00369 # define PLATFORMSTL_HAS_ATOMIC_PREADD
00370 # define PLATFORMSTL_HAS_ATOMIC_POSTADD
00371
00372 # else
00373 # error Not valid for processors other than Intel
00374 # endif
00375 # else
00376 # error Operating system not discriminated
00377 # endif
00378 # endif
00379 #endif
00380
00381
00382
00383 #if !defined(__cplusplus)
00384
00385 #elif defined(_STLSOFT_NO_NAMESPACE) || \
00386 defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
00387 }
00388 #else
00389 }
00390 }
00391 #endif
00392
00393
00394
00395 #endif
00396
00397