diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2020-03-09 11:58:33 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2020-03-09 12:20:49 +0800 |
commit | 1f006eef387a519abfff9392dd158332fbac390d (patch) | |
tree | 578da6dac3f889e693c93e7f76edb28c0eaa58c3 /glib/glibmmconfig.h.in | |
parent | 0bcdad1163b6937bb84713116c9bdc9491dc0e95 (diff) | |
download | glibmm-1f006eef387a519abfff9392dd158332fbac390d.tar.gz |
glibmm: Update glibmmconfig.h.[in|meson] for MSVC
Visual Studio 2015 or later has thread_local, so make sure that it is
enabled.
Also update for Visual Studio 2017+ as the compiler does allow static
members to be initialized inline to std::string::npos
(GLIBMM_HAVE_ALLOWS_STATIC_INLINE_NPOS), but use a work
around for pre-Visual Studio 2015 so that we do not get a linker error
as GLIBMM_HAVE_ALLOWS_STATIC_INLINE_NPOS is not supported.
Diffstat (limited to 'glib/glibmmconfig.h.in')
-rw-r--r-- | glib/glibmmconfig.h.in | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/glib/glibmmconfig.h.in b/glib/glibmmconfig.h.in index aa158038..7cf76292 100644 --- a/glib/glibmmconfig.h.in +++ b/glib/glibmmconfig.h.in @@ -98,7 +98,18 @@ #define thread_local __declspec (thread) #endif +#else + +/* thread_local is supported on Visual Studio 2015+ */ +#define GLIBMM_CAN_USE_THREAD_LOCAL 1 + #endif /* _MSC_VER < 1900 */ + +/* We have GLIBMM_HAVE_ALLOWS_STATIC_INLINE_NPOS for Visual Studio 2017+ */ +#if (_MSC_VER >= 1910) +#define GLIBMM_HAVE_ALLOWS_STATIC_INLINE_NPOS 1 +#endif + #endif /* GLIBMM_MSC */ /* Enable DLL-specific stuff only when not building a static library */ |