]> 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 06:14:27 +0000 (09:14 +0300)
src/lib/compat.h

index afdb9c6c3b5ea94d1ebed26ed175bdf6ca371784..449664ca2c8a8de43db34d41579e183d20e1999c 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