[glibmm] glibmmconfig.h.in: Fix Visual Studio 2013 builds



commit 531980716af3a8d6284801e13a2e807d082eee3d
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu Jan 14 16:01:16 2016 +0800

    glibmmconfig.h.in: Fix Visual Studio 2013 builds
    
    The thread_local keyword is only supported natively on Visual Studio 2015,
    so we need to use the Microsoft-specific extension __declspec(thread) for
    supporting thread_local in Visual Studio 2013 builds.
    
    Also re-organize the Visual Studio 2013-specific parts a bit so that it is
    clearer to people.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760612

 glib/glibmmconfig.h.in |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/glib/glibmmconfig.h.in b/glib/glibmmconfig.h.in
index 241aea3..a36c293 100644
--- a/glib/glibmmconfig.h.in
+++ b/glib/glibmmconfig.h.in
@@ -113,12 +113,25 @@
 # define GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED 1
 # pragma warning (disable: 4786 4355 4800 4181)
 
-#if (_MSC_VER < 1900) && !defined (noexcept)
+#if (_MSC_VER < 1900)
+/* The C++-11 keywords noexcept and thread_local are supported on
+ * Visual Studio 2013 via Microsoft-specific extensions, but are
+ * supported directly in Visual Studio 2015
+ */
+
 #define _ALLOW_KEYWORD_MACROS 1
+
+#ifndef noexcept
 #define noexcept _NOEXCEPT
 #endif
+
+#ifndef thread_local
+#define thread_local __declspec (thread)
 #endif
 
+#endif /* _MSC_VER < 1900 */
+#endif /* GLIBMM_MSC */
+
 /* Dummy macro definition for compatibility with old code that expects
  * it to be defined.  Remove after grace period. */
 #define GLIBMM_USING_STD(Symbol)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]