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/glibmm | |
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/glibmm')
-rw-r--r-- | glib/glibmm/ustring.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/glib/glibmm/ustring.h b/glib/glibmm/ustring.h index c9e24cd1..f0be919f 100644 --- a/glib/glibmm/ustring.h +++ b/glib/glibmm/ustring.h @@ -29,6 +29,11 @@ #include <string> #include <type_traits> +/* work around linker error on Visual Studio if we don't have GLIBMM_HAVE_ALLOWS_STATIC_INLINE_NPOS */ +#if (_MSC_VER >= 1600) && !defined (GLIBMM_HAVE_ALLOWS_STATIC_INLINE_NPOS) +const std::basic_string<char>::size_type std::basic_string<char>::npos = (std::basic_string<char>::size_type) -1; +#endif + namespace Glib { |