Skip to content

Commit

Permalink
Refined OS X compatibility check with overalignment on C++17 (thanks …
Browse files Browse the repository at this point in the history
…to szarvas) (issue cameron314#99)
  • Loading branch information
cameron314 committed Sep 1, 2020
1 parent 9ede8af commit a500a29
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions readerwriterqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,19 @@
#endif

#ifndef MOODYCAMEL_MAYBE_ALIGN_TO_CACHELINE
#if TARGET_OS_MAC && __cplusplus >= 201703L
#if defined (__APPLE__) && defined (__MACH__) && __cplusplus >= 201703L
// This is required to find out what deployment target we are using
#include <CoreFoundation/CoreFoundation.h>
#if !defined(MAC_OS_X_VERSION_MIN_REQUIRED) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_14
// C++17 new(size_t, align_val_t) is not backwards-compatible with older versions of macOS, so we can't support over-alignment in this case
#define MOODYCAMEL_MAYBE_ALIGN_TO_CACHELINE
#else
#define MOODYCAMEL_MAYBE_ALIGN_TO_CACHELINE AE_ALIGN(MOODYCAMEL_CACHE_LINE_SIZE)
#endif
#endif
#endif

#ifndef MOODYCAMEL_MAYBE_ALIGN_TO_CACHELINE
#define MOODYCAMEL_MAYBE_ALIGN_TO_CACHELINE AE_ALIGN(MOODYCAMEL_CACHE_LINE_SIZE)
#endif

#ifdef AE_VCPP
#pragma warning(push)
Expand Down

0 comments on commit a500a29

Please sign in to comment.