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 diff --git a/glib/goption.c b/glib/goption.c index 785b151f0..8ac283ce4 100644 --- a/glib/goption.c +++ b/glib/goption.c @@ -56,7 +56,7 @@ typedef struct gpointer arg_data; union { - gboolean bool; + gboolean boolean; gint integer; gchar *str; gchar **array; @@ -1585,7 +1585,7 @@ free_changes_list (GOptionContext *context, switch (change->arg_type) { case G_OPTION_ARG_NONE: - *(gboolean *)change->arg_data = change->prev.bool; + *(gboolean *)change->arg_data = change->prev.boolean; break; case G_OPTION_ARG_INT: *(gint *)change->arg_data = change->prev.integer;