Make olde code-path for constant with enum available again for older GCC versions.

According to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69960
a C extension to constant initializers is needed which is available only in recent versions. 8.1 is proven, I suppose 8.0 in this patch
This commit is contained in:
Riccardo Mottola 2025-03-31 22:50:49 +02:00
parent c19d77bd0e
commit 6e39f11098

View file

@ -292,7 +292,12 @@ typedef NS_ENUM(NSInteger, NSComparisonResult)
NSOrderedAscending = (NSInteger)-1, NSOrderedSame, NSOrderedDescending
};
// check for older versions of GCC and try to ignore clang pretending to know GNUC dialects
#if defined(__GNUC__) && !defined(__clang__) && GCC_VERSION < 80000
enum {NSNotFound = NSIntegerMax};
#else
static const NSInteger NSNotFound = NSIntegerMax;
#endif
DEFINE_BLOCK_TYPE(NSComparator, NSComparisonResult, id, id);