[glibmm] glib/glibmmconfig.h: Allow Build on Visual Studio 2013
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] glib/glibmmconfig.h: Allow Build on Visual Studio 2013
- Date: Wed, 9 Sep 2015 09:07:21 +0000 (UTC)
commit 4e7bc1af8a18152ef7696f1fdc6914c14ec6f6f4
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Wed Sep 2 16:16:26 2015 +0800
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
glib/glibmmconfig.h.in | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/glib/glibmmconfig.h.in b/glib/glibmmconfig.h.in
index 65304cc..241aea3 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]