Skip to content

Commit 6dd38b8

Browse files
authored
Merge pull request cameron314#346 from v1gnesh/master
Support to build on zOS
2 parents 810f621 + f26309a commit 6dd38b8

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

concurrentqueue.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ namespace moodycamel { namespace details {
105105
static const thread_id_t invalid_thread_id2 = 0xFFFFFFFFU; // Not technically guaranteed to be invalid, but is never used in practice. Note that all Win32 thread IDs are presently multiples of 4.
106106
static inline thread_id_t thread_id() { return static_cast<thread_id_t>(::GetCurrentThreadId()); }
107107
} }
108-
#elif defined(__arm__) || defined(_M_ARM) || defined(__aarch64__) || (defined(__APPLE__) && TARGET_OS_IPHONE) || defined(MOODYCAMEL_NO_THREAD_LOCAL)
108+
#elif defined(__arm__) || defined(_M_ARM) || defined(__aarch64__) || (defined(__APPLE__) && TARGET_OS_IPHONE) || defined(__MVS__) || defined(MOODYCAMEL_NO_THREAD_LOCAL)
109109
namespace moodycamel { namespace details {
110110
static_assert(sizeof(std::thread::id) == 4 || sizeof(std::thread::id) == 8, "std::thread::id is expected to be either 4 or 8 bytes");
111111

@@ -217,7 +217,7 @@ namespace moodycamel { namespace details {
217217
// VS2013 doesn't support `thread_local`, and MinGW-w64 w/ POSIX threading has a crippling bug: http://sourceforge.net/p/mingw-w64/bugs/445
218218
// g++ <=4.7 doesn't support thread_local either.
219219
// Finally, iOS/ARM doesn't have support for it either, and g++/ARM allows it to compile but it's unconfirmed to actually work
220-
#if (!defined(_MSC_VER) || _MSC_VER >= 1900) && (!defined(__MINGW32__) && !defined(__MINGW64__) || !defined(__WINPTHREADS_VERSION)) && (!defined(__GNUC__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) && (!defined(__APPLE__) || !TARGET_OS_IPHONE) && !defined(__arm__) && !defined(_M_ARM) && !defined(__aarch64__)
220+
#if (!defined(_MSC_VER) || _MSC_VER >= 1900) && (!defined(__MINGW32__) && !defined(__MINGW64__) || !defined(__WINPTHREADS_VERSION)) && (!defined(__GNUC__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) && (!defined(__APPLE__) || !TARGET_OS_IPHONE) && !defined(__arm__) && !defined(_M_ARM) && !defined(__aarch64__) && !defined(__MVS__)
221221
// Assume `thread_local` is fully supported in all other C++11 compilers/platforms
222222
#define MOODYCAMEL_CPP11_THREAD_LOCAL_SUPPORTED // tentatively enabled for now; years ago several users report having problems with it on
223223
#endif

lightweightsemaphore.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ extern "C" {
2424
}
2525
#elif defined(__MACH__)
2626
#include <mach/mach.h>
27+
#elif defined(__MVS__)
28+
#include <zos-semaphore.h>
2729
#elif defined(__unix__)
2830
#include <semaphore.h>
2931

@@ -165,9 +167,9 @@ class Semaphore
165167
}
166168
}
167169
};
168-
#elif defined(__unix__)
170+
#elif defined(__unix__) || defined(__MVS__)
169171
//---------------------------------------------------------
170-
// Semaphore (POSIX, Linux)
172+
// Semaphore (POSIX, Linux, zOS)
171173
//---------------------------------------------------------
172174
class Semaphore
173175
{

0 commit comments

Comments
 (0)