]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: COMPILE_ERROR_IF_TRUE() - Return FALSE instead of 0
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 9 Nov 2020 13:39:57 +0000 (15:39 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 9 Nov 2020 15:06:11 +0000 (17:06 +0200)
This will be needed for the following changes to avoid warnings with
-Wstrict-bool.

src/lib/macros.h

index 879880d7dc13cd0382e9fb9984a91a9edab9be2a..e93ce6352d2695ec16a46e6d2de9256bfaf1d764 100644 (file)
 
 #if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)) && !defined(__cplusplus)
 #  define COMPILE_ERROR_IF_TRUE(condition) \
-       (sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) - 1)
+       (sizeof(char[1 - 2 * ((condition) ? 1 : 0)]) > 0 ? FALSE : FALSE)
 #else
-#  define COMPILE_ERROR_IF_TRUE(condition) 0
+#  define COMPILE_ERROR_IF_TRUE(condition) FALSE
 #endif
 
 #ifdef HAVE_TYPE_CHECKS