[glib] Add MSVC implementations of G_GNUC_*_IGNORE_DEPRECATIONS
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Add MSVC implementations of G_GNUC_*_IGNORE_DEPRECATIONS
- Date: Mon, 29 Jul 2013 02:26:19 +0000 (UTC)
commit d0b4f59e8cffc9da8d6e2a856687d34ed2765c3a
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Fri Jul 19 19:10:41 2013 +0800
Add MSVC implementations of G_GNUC_*_IGNORE_DEPRECATIONS
As Visual Studio 2008 and later have support for the __pragma keyword,
where the compiler pragmas can be used in a macro, we can support
G_GNUC_BEGIN_IGNORE_DEPRECATIONS and G_GNUC_END_IGNORE_DEPRECATIONS
for Visual Studio 2008 and later, so many deprecation (C4996) warnings
can be suppressed when using these compilers when we use these macros
in the code.
https://bugzilla.gnome.org/show_bug.cgi?id=704543
glib/gmacros.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/glib/gmacros.h b/glib/gmacros.h
index 9526cbd..b37b08e 100644
--- a/glib/gmacros.h
+++ b/glib/gmacros.h
@@ -120,6 +120,12 @@
_Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#define G_GNUC_END_IGNORE_DEPRECATIONS \
_Pragma ("GCC diagnostic pop")
+#elif defined (_MSC_VER) && (_MSC_VER >= 1500)
+#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
+ __pragma (warning (push)) \
+ __pragma (warning (disable : 4996))
+#define G_GNUC_END_IGNORE_DEPRECATIONS \
+ __pragma (warning (pop))
#else
#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS
#define G_GNUC_END_IGNORE_DEPRECATIONS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]