diff --git a/objc/runtime.h b/objc/runtime.h index 979562c..c3c976f 100644 --- a/objc/runtime.h +++ b/objc/runtime.h @@ -190,30 +190,32 @@ typedef struct #ifndef YES -# define YES ((BOOL)1) +# if __has_feature(objc_bool) +# define YES __objc_yes +# else +# define YES ((BOOL)1) +# endif #endif #ifndef NO -# define NO ((BOOL)0) -#endif - -#ifdef __GNUC -# define _OBJC_NULL_PTR __null -#elif defined(__cplusplus) -# if __has_feature(cxx_nullptr) -# define _OBJC_NULL_PTR nullptr +# if __has_feature(objc_bool) +# define NO __objc_no # else -# define _OBJC_NULL_PTR 0 +# define NO ((BOOL)0) # endif +#endif + +#if __has_feature(cxx_nullptr) +# define _OBJC_NULL_PTR nullptr #else -# define _OBJC_NULL_PTR ((void*)0) +# define _OBJC_NULL_PTR NULL #endif #ifndef nil -# define nil ((id)_OBJC_NULL_PTR) +# define nil _OBJC_NULL_PTR #endif #ifndef Nil -# define Nil ((Class)_OBJC_NULL_PTR) +# define Nil _OBJC_NULL_PTR #endif #include "slot.h"