blob: 02816a887cc9570c8c9505dc2a2fd849292d281c [file] [log] [blame]
From eee7e3c6688f2f1ee9beed5d6d209973c1df387e Mon Sep 17 00:00:00 2001
From: Philip Withnall <pwithnall@endlessos.org>
Date: Wed, 11 Nov 2020 19:14:25 +0000
Subject: [PATCH 17/29] gmessages: Drop unnecessary volatile qualifiers from
macro variables
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Its not necessary and provides no thread safety guarantees.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Helps: #600
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719]
---
glib/gmessages.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/glib/gmessages.h b/glib/gmessages.h
index 6a28443b4..2e3650baf 100644
--- a/glib/gmessages.h
+++ b/glib/gmessages.h
@@ -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); \
--
2.30.1