[sound-juicer] Add SJ_BEGIN/END_IGNORE_SWITCH_ENUM
- From: Phillip Wood <pwood src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sound-juicer] Add SJ_BEGIN/END_IGNORE_SWITCH_ENUM
- Date: Mon, 13 Feb 2017 10:57:04 +0000 (UTC)
commit 96f8999246ae291b1cb25b380a8a19b86132d522
Author: Phillip Wood <phillip wood dunelm org uk>
Date: Thu Nov 10 11:14:48 2016 +0000
Add SJ_BEGIN/END_IGNORE_SWITCH_ENUM
These provide a simple way to disable -Wswitch-enum warnings where they
are unhelpful.
https://bugzilla.gnome.org/show_bug.cgi?id=777692
squash! Add SJ_BEGIN/END_IGNORE_SWITCH_ENUM
libjuicer/sj-util.h | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/libjuicer/sj-util.h b/libjuicer/sj-util.h
index ec28518..f365981 100644
--- a/libjuicer/sj-util.h
+++ b/libjuicer/sj-util.h
@@ -51,4 +51,16 @@ gboolean sj_str_is_empty (const char *s);
#define SJ_END_IGNORE_DISCARDED_QUANTIFIERS
#endif
+#if G_GNUC_CHECK_VERSION (4,2)
+#define SJ_BEGIN_IGNORE_SWITCH_ENUM \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wswitch-enum\"")
+
+#define SJ_END_IGNORE_SWITCH_ENUM \
+ _Pragma ("GCC diagnostic pop")
+#else
+#define SJ_BEGIN_IGNORE_SWITCH_ENUM
+#define SJ_END_IGNORE_SWITCH_ENUM
+#endif
+
#endif /* SJ_UTIL_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]