From 67d89a5a87a168ae4637b6c1032596df48e36892 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 11 Apr 2024 14:45:02 +0100 Subject: [PATCH] Alias TRUE and FALSE to C99's true and false GLib depends on a C99 toolchain. While we cannot change `gboolean`, we can at least use the same boolean constants. Fixes: #3326 --- glib/gmacros.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/glib/gmacros.h b/glib/gmacros.h index 2d66c2f0c..403bad000 100644 --- a/glib/gmacros.h +++ b/glib/gmacros.h @@ -39,6 +39,9 @@ */ #include +/* We include stdbool.h to get the system's definition of true and false */ +#include + /* * Note: Clang (but not clang-cl) defines __GNUC__ and __GNUC_MINOR__. * Both Clang 11.1 on current Arch Linux and Apple's Clang 12.0 define @@ -922,11 +925,11 @@ #endif #ifndef FALSE -#define FALSE (0) +#define FALSE false #endif #ifndef TRUE -#define TRUE (!FALSE) +#define TRUE true #endif #undef MAX