gnustep / libobjc2

Objective-C runtime library intended for use with Clang.
http://www.gnustep.org/
MIT License
434 stars 118 forks source link

_Bool fix for cpp compilation #116

Closed jordo closed 5 years ago

jordo commented 5 years ago

_Bool isn't defined when compiling from (.mm) objc++ files.

davidchisnall commented 5 years ago

What is the #include <stdbool.h> for? This defines bool in C and should have no effect in C++ mode. I think it would be cleaner to either #include <stdbool.h> in C mode and just use bool everywhere (may break old C code, but is probably fine) or define an OBJC_BOOL macro that is either bool or _Bool depending on whether we're in C or C++ mode.

jordo commented 5 years ago

oops I thought i have taken that out before the pull req, I can remove. Just using bool does break C code in other libraries (dispatch) for example. But ya, agreed OBJC_BOOL would be cleaner and I can guard it, as I wasn't sure if OBJC_BOOL could be defined on some other lib or something.