blob: 02816a887cc9570c8c9505dc2a2fd849292d281c [file] [log] [blame]
Andrew Geissler95ac1b82021-03-31 14:34:31 -05001From eee7e3c6688f2f1ee9beed5d6d209973c1df387e Mon Sep 17 00:00:00 2001
2From: Philip Withnall <pwithnall@endlessos.org>
3Date: Wed, 11 Nov 2020 19:14:25 +0000
4Subject: [PATCH 17/29] gmessages: Drop unnecessary volatile qualifiers from
5 macro variables
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10Its not necessary and provides no thread safety guarantees.
11
12Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
13
14Helps: #600
15Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719]
16---
17 glib/gmessages.h | 4 ++--
18 1 file changed, 2 insertions(+), 2 deletions(-)
19
20diff --git a/glib/gmessages.h b/glib/gmessages.h
21index 6a28443b4..2e3650baf 100644
22--- a/glib/gmessages.h
23+++ b/glib/gmessages.h
24@@ -478,7 +478,7 @@ g_debug (const gchar *format,
25 #if defined(G_HAVE_ISO_VARARGS) && !G_ANALYZER_ANALYZING
26 #define g_warning_once(...) \
27 G_STMT_START { \
28- static volatile int G_PASTE (_GWarningOnceBoolean, __LINE__) = 0; \
29+ static int G_PASTE (_GWarningOnceBoolean, __LINE__) = 0; /* (atomic) */ \
30 if (g_atomic_int_compare_and_exchange (&G_PASTE (_GWarningOnceBoolean, __LINE__), \
31 0, 1)) \
32 g_warning (__VA_ARGS__); \
33@@ -487,7 +487,7 @@ g_debug (const gchar *format,
34 #elif defined(G_HAVE_GNUC_VARARGS) && !G_ANALYZER_ANALYZING
35 #define g_warning_once(format...) \
36 G_STMT_START { \
37- static volatile int G_PASTE (_GWarningOnceBoolean, __LINE__) = 0; \
38+ static int G_PASTE (_GWarningOnceBoolean, __LINE__) = 0; /* (atomic) */ \
39 if (g_atomic_int_compare_and_exchange (&G_PASTE (_GWarningOnceBoolean, __LINE__), \
40 0, 1)) \
41 g_warning (format); \
42--
432.30.1
44