libs-base
libs-base copied to clipboard
Add common constants defined in `MacTypes.h` in the macOS SDKs?
I work with a codebase that is regularly cross compiling for both mac and linux targets, there are a few semi-common constants defined in MacTypes.h in the macOS SDKs that end up getting used which break our linux builds anytime someone checks them in (unfortunately, we only have nightly CI job that catches these cross-compiling issues).
Excerpts from MacTypes.h:
// noErr OSErr: function performed properly - no error
// kNilOptions OptionBits: all flags false
// kInvalidID KernelID: NULL is for pointers as kInvalidID is for ID's
// kVariableLengthArray array bounds: variable length array
...
enum {
noErr = 0
};
enum {
kNilOptions = 0
};
#define kInvalidID 0
enum {
kVariableLengthArray
#ifdef __has_extension
#if __has_extension(enumerator_attributes)
__attribute__((deprecated))
#endif
#endif
= 1
};
enum {
kUnknownType = 0x3F3F3F3F /* "????" QuickTime 3.0: default unknown ResType or OSType */
};
Would it make sense to include these definitions at the gnustep-base layer?
I think this is an interesting issue, in spite of being simple.
I don't see any particular problems adding another OSX compatibility header ... unless it breaks building on OSX somehow.