From: Timo Sirainen Date: Fri, 7 Apr 2017 06:14:27 +0000 (+0300) Subject: lib: Redefine NULL only if HAVE_TYPE_CHECKS is set X-Git-Tag: 2.3.0.rc1~1777 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76858e9df2a1b94ab42a6dcd5b2cb7932f083399;p=thirdparty%2Fdovecot%2Fcore.git lib: Redefine NULL only if HAVE_TYPE_CHECKS is set --- diff --git a/src/lib/compat.h b/src/lib/compat.h index afdb9c6c3b..449664ca2c 100644 --- a/src/lib/compat.h +++ b/src/lib/compat.h @@ -17,8 +17,10 @@ #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