mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-31 04:43:06 +02:00
Merge branch 'ebassi/c99-boolean-constants' into 'main'
Alias TRUE and FALSE to C99's true and false Closes #3326 See merge request GNOME/glib!4001
This commit is contained in:
commit
4d2e0df9ee
@ -39,6 +39,9 @@
|
|||||||
*/
|
*/
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
/* We include stdbool.h to get the system's definition of true and false */
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note: Clang (but not clang-cl) defines __GNUC__ and __GNUC_MINOR__.
|
* 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
|
* Both Clang 11.1 on current Arch Linux and Apple's Clang 12.0 define
|
||||||
@ -922,11 +925,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FALSE
|
#ifndef FALSE
|
||||||
#define FALSE (0)
|
#define FALSE false
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef TRUE
|
#ifndef TRUE
|
||||||
#define TRUE (!FALSE)
|
#define TRUE true
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef MAX
|
#undef MAX
|
||||||
|
@ -56,7 +56,7 @@ typedef struct
|
|||||||
gpointer arg_data;
|
gpointer arg_data;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
gboolean bool;
|
gboolean boolean;
|
||||||
gint integer;
|
gint integer;
|
||||||
gchar *str;
|
gchar *str;
|
||||||
gchar **array;
|
gchar **array;
|
||||||
@ -1585,7 +1585,7 @@ free_changes_list (GOptionContext *context,
|
|||||||
switch (change->arg_type)
|
switch (change->arg_type)
|
||||||
{
|
{
|
||||||
case G_OPTION_ARG_NONE:
|
case G_OPTION_ARG_NONE:
|
||||||
*(gboolean *)change->arg_data = change->prev.bool;
|
*(gboolean *)change->arg_data = change->prev.boolean;
|
||||||
break;
|
break;
|
||||||
case G_OPTION_ARG_INT:
|
case G_OPTION_ARG_INT:
|
||||||
*(gint *)change->arg_data = change->prev.integer;
|
*(gint *)change->arg_data = change->prev.integer;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user