mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Merge pull request #499 from gnustep/const_gcc_fix
Make old code-path for constant with enum available again for older GCC versions
This commit is contained in:
commit
9f8c181ab5
1 changed files with 6 additions and 0 deletions
|
@ -292,7 +292,13 @@ 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
|
||||
// in order to work around error "initializer element is not constant" in older GCC versions
|
||||
#if defined(__GNUC__) && !defined(__clang__) && GCC_VERSION < 80000
|
||||
#define NSNotFound NSIntegerMax
|
||||
#else
|
||||
static const NSInteger NSNotFound = NSIntegerMax;
|
||||
#endif
|
||||
|
||||
DEFINE_BLOCK_TYPE(NSComparator, NSComparisonResult, id, id);
|
||||
|
||||
|
|
Loading…
Reference in a new issue