summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2015-09-02 16:16:26 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2015-09-09 17:06:12 +0800
commit4e7bc1af8a18152ef7696f1fdc6914c14ec6f6f4 (patch)
tree5b11abcc76adde3f22e1cae8de6fd56ea68da840
parentbb84ab2ca601b59acb16075d7821ca65bba9c9b0 (diff)
downloadglibmm-4e7bc1af8a18152ef7696f1fdc6914c14ec6f6f4.tar.gz
glib/glibmmconfig.h: Allow Build on Visual Studio 2013
Visual Studio 2013 supports enough of C++-11 to support the build of glibmm, except that it does not support noexcept (which is something that Visual Studio 2015 supports). Define noexcept as _NOEXCEPT on Visual Studio 2013, so that one can build glibmm on it. Note that since later Visual Studio versions do not allow one to define known keywords like noexcet as macros, we need to define _ALLOW_KEYWORD_MACROS to workaround this limitation. https://bugzilla.gnome.org/show_bug.cgi?id=753271
-rw-r--r--glib/glibmmconfig.h.in5
1 files changed, 5 insertions, 0 deletions
diff --git a/glib/glibmmconfig.h.in b/glib/glibmmconfig.h.in
index 65304cc8..241aea36 100644
--- a/glib/glibmmconfig.h.in
+++ b/glib/glibmmconfig.h.in
@@ -112,6 +112,11 @@
# define GLIBMM_EXCEPTIONS_ENABLED 1
# define GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED 1
# pragma warning (disable: 4786 4355 4800 4181)
+
+#if (_MSC_VER < 1900) && !defined (noexcept)
+#define _ALLOW_KEYWORD_MACROS 1
+#define noexcept _NOEXCEPT
+#endif
#endif
/* Dummy macro definition for compatibility with old code that expects