Archived
compilersupport: add support for C23's nullptr
It has the same semantics as C++11's `nullptr`. Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
@@ -202,10 +202,14 @@
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define CONST_CAST(t, v) const_cast<t>(v)
|
||||
# define CBOR_NULLPTR nullptr
|
||||
#else
|
||||
/* C-style const_cast without triggering a warning with -Wcast-qual */
|
||||
# define CONST_CAST(t, v) (t)(uintptr_t)(v)
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) || __STDC_VERSION__ >= 202311
|
||||
# define CBOR_NULLPTR nullptr
|
||||
#else
|
||||
# define CBOR_NULLPTR NULL
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user