diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2016-01-14 16:01:16 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2016-01-20 17:37:07 +0800 |
commit | 531980716af3a8d6284801e13a2e807d082eee3d (patch) | |
tree | 0a9bd11b16c1cdfec1162eb2312d693776ff036f /glib/glibmmconfig.h.in | |
parent | 98b24c483d590a9ec5ea5ec9932698fa02689441 (diff) | |
download | glibmm-531980716af3a8d6284801e13a2e807d082eee3d.tar.gz |
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
Diffstat (limited to 'glib/glibmmconfig.h.in')
-rw-r--r-- | 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 241aea36..a36c293b 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) |