diff --git a/src/compilersupport_p.h b/src/compilersupport_p.h index 92517997..4baf9bd5 100644 --- a/src/compilersupport_p.h +++ b/src/compilersupport_p.h @@ -202,10 +202,14 @@ #ifdef __cplusplus # define CONST_CAST(t, v) const_cast(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