File indexing completed on 2025-12-16 09:53:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_INTERPROCESS_DETAIL_WORKAROUND_HPP
0012 #define BOOST_INTERPROCESS_DETAIL_WORKAROUND_HPP
0013
0014 #ifndef BOOST_CONFIG_HPP
0015 # include <boost/config.hpp>
0016 #endif
0017 #
0018 #if defined(BOOST_HAS_PRAGMA_ONCE)
0019 # pragma once
0020 #endif
0021
0022 #if defined(BOOST_INTERPROCESS_FORCE_NATIVE_EMULATION) && defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION)
0023 #error "BOOST_INTERPROCESS_FORCE_NATIVE_EMULATION && BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION can't be defined at the same time"
0024 #endif
0025
0026
0027
0028 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
0029 #define BOOST_INTERPROCESS_WINDOWS
0030 #if !defined(BOOST_INTERPROCESS_FORCE_NATIVE_EMULATION) && !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION)
0031 #define BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION
0032 #endif
0033 #define BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME
0034 #else
0035 #include <unistd.h>
0036
0037 #if defined (__CYGWIN__) && (!defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE < 200112L))
0038 #error "Error: Compiling on Cygwin without POSIX is not supported. Please define _XOPEN_SOURCE >= 600 or _POSIX_C_SOURCE >= 200112 when compiling"
0039 #endif
0040
0041
0042
0043
0044 #if !defined(__QNXNTO__) && !defined(__ANDROID__) && !defined(__HAIKU__) && !(__VXWORKS__) && !(__EMSCRIPTEN__)
0045 #define BOOST_INTERPROCESS_XSI_SHARED_MEMORY_OBJECTS
0046 #endif
0047
0048
0049
0050
0051 #if defined(_XOPEN_UNIX) && ((_XOPEN_VERSION + 0) >= 500)
0052 #define BOOST_INTERPROCESS_POSIX_RECURSIVE_MUTEXES
0053 #endif
0054
0055
0056
0057
0058 #if defined(_POSIX_THREAD_PROCESS_SHARED) && ((_POSIX_THREAD_PROCESS_SHARED + 0) > 0)
0059
0060 #if defined(__CYGWIN__)
0061 #define BOOST_INTERPROCESS_BUGGY_POSIX_PROCESS_SHARED
0062 #elif defined(__APPLE__)
0063
0064
0065
0066
0067 #define BOOST_INTERPROCESS_BUGGY_POSIX_PROCESS_SHARED
0068 #endif
0069
0070
0071 #if defined(BOOST_INTERPROCESS_BUGGY_POSIX_PROCESS_SHARED)
0072 #undef BOOST_INTERPROCESS_BUGGY_POSIX_PROCESS_SHARED
0073 #else
0074 #define BOOST_INTERPROCESS_POSIX_PROCESS_SHARED
0075 #endif
0076 #endif
0077
0078
0079
0080
0081 #if (_XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L)
0082 #define BOOST_INTERPROCESS_POSIX_ROBUST_MUTEXES
0083 #endif
0084
0085
0086
0087
0088 #if ( defined(_POSIX_SHARED_MEMORY_OBJECTS) && ((_POSIX_SHARED_MEMORY_OBJECTS + 0) > 0) ) ||\
0089 (defined(__vms) && __CRTL_VER >= 70200000)
0090 #define BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS
0091
0092
0093
0094
0095 #if defined(__hpux) || defined(__osf__) || defined(__vms) || (defined(__FreeBSD__) && (__FreeBSD__ < 7))
0096 #define BOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_SHARED_MEMORY
0097
0098
0099 #elif defined(__FreeBSD__)
0100 #define BOOST_INTERPROCESS_RUNTIME_FILESYSTEM_BASED_POSIX_SHARED_MEMORY
0101 #endif
0102 #endif
0103
0104
0105
0106
0107 #if defined(_POSIX_MAPPED_FILES) && ((_POSIX_MAPPED_FILES + 0) > 0)
0108 #define BOOST_INTERPROCESS_POSIX_MAPPED_FILES
0109 #endif
0110
0111
0112
0113
0114 #if ( defined(_POSIX_SEMAPHORES) && ((_POSIX_SEMAPHORES + 0) > 0) ) ||\
0115 ( defined(__FreeBSD__) && (__FreeBSD__ >= 4)) || \
0116 defined(__APPLE__)
0117 #define BOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES
0118
0119 #if !defined(__APPLE__)
0120 #define BOOST_INTERPROCESS_POSIX_UNNAMED_SEMAPHORES
0121 #endif
0122 #if defined(__osf__) || defined(__vms)
0123 #define BOOST_INTERPROCESS_FILESYSTEM_BASED_POSIX_SEMAPHORES
0124 #endif
0125 #endif
0126
0127
0128
0129
0130 #if defined(_POSIX_BARRIERS) && ((_POSIX_BARRIERS + 0) >= 200112L)
0131 #define BOOST_INTERPROCESS_POSIX_BARRIERS
0132 #endif
0133
0134
0135
0136
0137 #if defined(_POSIX_TIMEOUTS) && ((_POSIX_TIMEOUTS + 0L) >= 200112L)
0138 #define BOOST_INTERPROCESS_POSIX_TIMEOUTS
0139 #endif
0140
0141
0142
0143
0144 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
0145 #define BOOST_INTERPROCESS_BSD_DERIVATIVE
0146
0147
0148 #include <sys/types.h>
0149 #include <sys/param.h>
0150 #include <sys/sysctl.h>
0151 #if defined(CTL_KERN) && defined (KERN_BOOTTIME)
0152
0153 #endif
0154 #endif
0155
0156
0157
0158
0159 #if (defined (_V6_ILP32_OFFBIG) &&(_V6_ILP32_OFFBIG - 0 > 0)) ||\
0160 (defined (_V6_LP64_OFF64) &&(_V6_LP64_OFF64 - 0 > 0)) ||\
0161 (defined (_V6_LPBIG_OFFBIG) &&(_V6_LPBIG_OFFBIG - 0 > 0)) ||\
0162 (defined (_XBS5_ILP32_OFFBIG)&&(_XBS5_ILP32_OFFBIG - 0 > 0)) ||\
0163 (defined (_XBS5_LP64_OFF64) &&(_XBS5_LP64_OFF64 - 0 > 0)) ||\
0164 (defined (_XBS5_LPBIG_OFFBIG)&&(_XBS5_LPBIG_OFFBIG - 0 > 0)) ||\
0165 (defined (_FILE_OFFSET_BITS) &&(_FILE_OFFSET_BITS - 0 >= 64))||\
0166 (defined (_FILE_OFFSET_BITS) &&(_FILE_OFFSET_BITS - 0 >= 64))
0167 #define BOOST_INTERPROCESS_UNIX_64_BIT_OR_BIGGER_OFF_T
0168 #endif
0169
0170
0171
0172
0173 #if (_XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 200112L)
0174 #define BOOST_INTERPROCESS_POSIX_FALLOCATE
0175 #endif
0176
0177 #endif
0178
0179 #if defined(BOOST_INTERPROCESS_WINDOWS) || defined(BOOST_INTERPROCESS_POSIX_MAPPED_FILES)
0180 # define BOOST_INTERPROCESS_MAPPED_FILES
0181 #endif
0182
0183
0184 #if defined(BOOST_INTERPROCESS_POSIX_NAMED_SEMAPHORES) && !defined(BOOST_INTERPROCESS_POSIX_SEMAPHORES_NO_UNLINK)
0185 #define BOOST_INTERPROCESS_NAMED_MUTEX_USES_POSIX_SEMAPHORES
0186 #define BOOST_INTERPROCESS_NAMED_SEMAPHORE_USES_POSIX_SEMAPHORES
0187 #endif
0188
0189 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
0190 #define BOOST_INTERPROCESS_PERFECT_FORWARDING
0191 #endif
0192
0193
0194 #ifndef BOOST_INTERPROCESS_TIMEOUT_WHEN_LOCKING_DURATION_MS
0195 #define BOOST_INTERPROCESS_TIMEOUT_WHEN_LOCKING_DURATION_MS 10000
0196 #endif
0197
0198
0199
0200 #ifndef BOOST_INTERPROCESS_MANAGED_OPEN_OR_CREATE_INITIALIZE_MAX_TRIES
0201 #define BOOST_INTERPROCESS_MANAGED_OPEN_OR_CREATE_INITIALIZE_MAX_TRIES 20u
0202 #endif
0203
0204
0205
0206 #ifndef BOOST_INTERPROCESS_MANAGED_OPEN_OR_CREATE_INITIALIZE_TIMEOUT_SEC
0207 #define BOOST_INTERPROCESS_MANAGED_OPEN_OR_CREATE_INITIALIZE_TIMEOUT_SEC 300u
0208 #endif
0209
0210
0211
0212
0213
0214
0215 #define BOOST_INTERPROCESS_MSG_QUEUE_CIRCULAR_INDEX
0216
0217
0218 #define BOOST_INTERPROCESS_IMPDEF(TYPE) TYPE
0219 #define BOOST_INTERPROCESS_SEEDOC(TYPE) TYPE
0220 #define BOOST_INTERPROCESS_DOC1ST(TYPE1, TYPE2) TYPE2
0221 #define BOOST_INTERPROCESS_I ,
0222 #define BOOST_INTERPROCESS_DOCIGN(T1) T1
0223
0224
0225
0226 #if defined(BOOST_INTERPROCESS_DISABLE_FORCEINLINE)
0227 #define BOOST_INTERPROCESS_FORCEINLINE inline
0228 #elif defined(BOOST_INTERPROCESS_FORCEINLINE_IS_BOOST_FORCELINE)
0229 #define BOOST_INTERPROCESS_FORCEINLINE BOOST_FORCEINLINE
0230 #elif defined(BOOST_MSVC) && (_MSC_VER < 1900 || defined(_DEBUG))
0231
0232 #define BOOST_INTERPROCESS_FORCEINLINE inline
0233 #elif defined(BOOST_CLANG) || (defined(BOOST_GCC) && ((__GNUC__ <= 5) || defined(__MINGW32__)))
0234
0235
0236
0237
0238 #define BOOST_INTERPROCESS_FORCEINLINE inline
0239 #else
0240 #define BOOST_INTERPROCESS_FORCEINLINE BOOST_FORCEINLINE
0241 #endif
0242
0243 #ifdef BOOST_WINDOWS
0244
0245 #define BOOST_INTERPROCESS_WCHAR_NAMED_RESOURCES
0246
0247 #ifdef __clang__
0248 #define BOOST_INTERPROCESS_DISABLE_DEPRECATED_WARNING _Pragma("clang diagnostic push") \
0249 _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
0250 #define BOOST_INTERPROCESS_RESTORE_WARNING _Pragma("clang diagnostic pop")
0251 #else
0252 #define BOOST_INTERPROCESS_DISABLE_DEPRECATED_WARNING __pragma(warning(push)) \
0253 __pragma(warning(disable : 4996))
0254 #define BOOST_INTERPROCESS_RESTORE_WARNING __pragma(warning(pop))
0255 #endif
0256
0257 #endif
0258
0259 #if defined(BOOST_HAS_THREADS)
0260 # if defined(_MSC_VER) || defined(__MWERKS__) || defined(__MINGW32__) || defined(__BORLANDC__)
0261
0262 # elif (!defined(__hpux) || (defined(__hpux) && defined(_REENTRANT)))
0263 # define BOOST_INTERPROCESS_HAS_REENTRANT_STD_FUNCTIONS
0264 # endif
0265 #endif
0266
0267 namespace boost {
0268 namespace interprocess {
0269
0270 template <typename T1>
0271 BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore(T1 const&)
0272 {}
0273
0274 }}
0275
0276 #if !(defined BOOST_NO_EXCEPTIONS)
0277 # define BOOST_INTERPROCESS_TRY { try
0278 # define BOOST_INTERPROCESS_CATCH(x) catch(x)
0279 # define BOOST_INTERPROCESS_RETHROW throw;
0280 # define BOOST_INTERPROCESS_CATCH_END }
0281 #else
0282 # if !defined(BOOST_MSVC) || BOOST_MSVC >= 1900
0283 # define BOOST_INTERPROCESS_TRY { if (true)
0284 # define BOOST_INTERPROCESS_CATCH(x) else if (false)
0285 # else
0286
0287 # define BOOST_INTERPROCESS_TRY { \
0288 __pragma(warning(push)) \
0289 __pragma(warning(disable: 4127)) \
0290 if (true) \
0291 __pragma(warning(pop))
0292 # define BOOST_INTERPROCESS_CATCH(x) else \
0293 __pragma(warning(push)) \
0294 __pragma(warning(disable: 4127)) \
0295 if (false) \
0296 __pragma(warning(pop))
0297 # endif
0298 # define BOOST_INTERPROCESS_RETHROW
0299 # define BOOST_INTERPROCESS_CATCH_END }
0300 #endif
0301
0302 #ifndef BOOST_NO_CXX11_STATIC_ASSERT
0303 # ifndef BOOST_NO_CXX11_VARIADIC_MACROS
0304 # define BOOST_INTERPROCESS_STATIC_ASSERT( ... ) static_assert(__VA_ARGS__, #__VA_ARGS__)
0305 # else
0306 # define BOOST_INTERPROCESS_STATIC_ASSERT( B ) static_assert(B, #B)
0307 # endif
0308 #else
0309 namespace boost {
0310 namespace interprocess {
0311 namespace dtl {
0312
0313 template<bool B>
0314 struct STATIC_ASSERTION_FAILURE;
0315
0316 template<>
0317 struct STATIC_ASSERTION_FAILURE<true> {};
0318
0319 template<unsigned> struct static_assert_test {};
0320
0321 }
0322 }
0323 }
0324
0325 #define BOOST_INTERPROCESS_STATIC_ASSERT(B) \
0326 typedef ::boost::interprocess::dtl::static_assert_test<\
0327 (unsigned)sizeof(::boost::interprocess::dtl::STATIC_ASSERTION_FAILURE<bool(B)>)>\
0328 BOOST_JOIN(boost_container_static_assert_typedef_, __LINE__) BOOST_ATTRIBUTE_UNUSED
0329
0330 #endif
0331
0332 #ifndef BOOST_NO_CXX11_STATIC_ASSERT
0333 # ifndef BOOST_NO_CXX11_VARIADIC_MACROS
0334 # define BOOST_INTERPROCESS_STATIC_ASSERT_MSG( ... ) static_assert(__VA_ARGS__)
0335 # else
0336 # define BOOST_INTERPROCESS_STATIC_ASSERT_MSG( B, Msg ) static_assert( B, Msg )
0337 # endif
0338 #else
0339 # define BOOST_INTERPROCESS_STATIC_ASSERT_MSG( B, Msg ) BOOST_INTERPROCESS_STATIC_ASSERT( B )
0340 #endif
0341
0342 #if !defined(BOOST_NO_CXX17_INLINE_VARIABLES)
0343 # define BOOST_INTERPROCESS_CONSTANT_VAR BOOST_INLINE_CONSTEXPR
0344 #else
0345 # define BOOST_INTERPROCESS_CONSTANT_VAR static BOOST_CONSTEXPR_OR_CONST
0346 #endif
0347
0348 #if defined(__GNUC__) && ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600)
0349 #define BOOST_INTERPROCESS_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED
0350 #elif defined(__clang__)
0351 #define BOOST_INTERPROCESS_GCC_COMPATIBLE_HAS_DIAGNOSTIC_IGNORED
0352 #endif
0353
0354
0355
0356
0357
0358
0359
0360
0361
0362 #if !defined(DISABLE_BOOST_INTERPROCESS_EINTR_RETRY) && defined(__GNUC__)
0363
0364
0365 #define BOOST_INTERPROCESS_EINTR_RETRY(RESULTTYPE, FAILUREVALUE, EXPRESSION) \
0366 (__extension__ \
0367 ({ RESULTTYPE __result; \
0368 do __result = (RESULTTYPE) (EXPRESSION); \
0369 while (__result == FAILUREVALUE && errno == EINTR); \
0370 __result; }))
0371
0372 #else
0373
0374 #define BOOST_INTERPROCESS_EINTR_RETRY(RESULTTYPE, FAILUREVALUE, EXPRESSION) ((RESULTTYPE)(EXPRESSION))
0375
0376 #endif
0377
0378 #endif