mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
gmessages: Drop unnecessary volatile qualifiers from macro variables
It’s not necessary and provides no thread safety guarantees. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #600
This commit is contained in:
parent
08d04d0428
commit
eee7e3c668
@ -478,7 +478,7 @@ g_debug (const gchar *format,
|
||||
#if defined(G_HAVE_ISO_VARARGS) && !G_ANALYZER_ANALYZING
|
||||
#define g_warning_once(...) \
|
||||
G_STMT_START { \
|
||||
static volatile int G_PASTE (_GWarningOnceBoolean, __LINE__) = 0; \
|
||||
static int G_PASTE (_GWarningOnceBoolean, __LINE__) = 0; /* (atomic) */ \
|
||||
if (g_atomic_int_compare_and_exchange (&G_PASTE (_GWarningOnceBoolean, __LINE__), \
|
||||
0, 1)) \
|
||||
g_warning (__VA_ARGS__); \
|
||||
@ -487,7 +487,7 @@ g_debug (const gchar *format,
|
||||
#elif defined(G_HAVE_GNUC_VARARGS) && !G_ANALYZER_ANALYZING
|
||||
#define g_warning_once(format...) \
|
||||
G_STMT_START { \
|
||||
static volatile int G_PASTE (_GWarningOnceBoolean, __LINE__) = 0; \
|
||||
static int G_PASTE (_GWarningOnceBoolean, __LINE__) = 0; /* (atomic) */ \
|
||||
if (g_atomic_int_compare_and_exchange (&G_PASTE (_GWarningOnceBoolean, __LINE__), \
|
||||
0, 1)) \
|
||||
g_warning (format); \
|
||||
|
Loading…
Reference in New Issue
Block a user