]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Redefine NULL only if HAVE_TYPE_CHECKS is set
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 7 Apr 2017 06:14:27 +0000 (09:14 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 7 Apr 2017 11:26:35 +0000 (14:26 +0300)
src/lib/compat.h

index 3984303fa3967d421432373e561d5f7bb93592ef..6579c2feb0e2aff7cb395651ee5d54707d20cdc6 100644 (file)
 #endif
 
 /* We really want NULL to be a pointer, since we have various type-checks
-   that may result in compiler warnings/errors if it's not. */
-#ifndef __cplusplus
+   that may result in compiler warnings/errors if it's not. Do this only when
+   type checking is used - it's not otherwise needed and causes compiling
+   problems with e.g. Sun C compiler. */
+#ifdef HAVE_TYPE_CHECKS
 #  undef NULL
 #  define NULL ((void *)0)
 #endif