Skip to content

Commit

Permalink
nil -> nullptr on C++11. nil can't be an id for block comparisons.
Browse files Browse the repository at this point in the history
  • Loading branch information
DHowett committed Jan 22, 2018
1 parent 375a009 commit 3d5994e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions objc/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,17 @@ typedef struct
#ifdef __GNUC
# define _OBJC_NULL_PTR __null
#elif defined(__cplusplus)
# define _OBJC_NULL_PTR 0
# if __has_feature(cxx_nullptr)
# define _OBJC_NULL_PTR nullptr
# else
# define _OBJC_NULL_PTR 0
# endif
#else
# define _OBJC_NULL_PTR ((void*)0)
#endif

#ifndef nil
# define nil ((id)_OBJC_NULL_PTR)
# define nil _OBJC_NULL_PTR
#endif

#ifndef Nil
Expand Down

0 comments on commit 3d5994e

Please sign in to comment.