-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Description
When I compile an .mm file (Objective-C++) with -fno-exceptions in Clang, __EXCEPTIONS is still #define'd to 1.
So if that .mm file #includes concurrentqueue.h, it tries to use C++ exceptions, and I get compile errors because they're disabled.
It seems that __EXCEPTIONS means: "we have some kind of exception handling (including Objective-C exceptions)", and does not mean: "C++ exceptions are enabled".
This can be solved by changing the relevant line to something like this:
#if (defined(_MSC_VER) && defined(_CPPUNWIND)) || (defined(__GNUC__) && !__OBJC__ && defined(__EXCEPTIONS)) || (__OBJC__ && __has_feature(cxx_exceptions)) || (!defined(_MSC_VER) && !defined(__GNUC__))
#define MOODYCAMEL_EXCEPTIONS_ENABLED
#endifI'm not sure whether that's the most concise and bullet-proof predicate.
The Clang docs recommend __has_feature(cxx_exceptions), though I'm not sure about backwards-compatibility.
Metadata
Metadata
Assignees
Labels
No labels