diff --git a/glib/glib-typeof.h b/glib/glib-typeof.h index ffc2a45c5..106859d7b 100644 --- a/glib/glib-typeof.h +++ b/glib/glib-typeof.h @@ -34,9 +34,12 @@ * This symbol is private. */ #undef glib_typeof -#if (!defined(__cplusplus) || __cplusplus < 201103L) && (G_GNUC_CHECK_VERSION(4, 8) || defined(__clang__)) +#if (!defined(__cplusplus) || (!defined (_MSVC_LANG) && __cplusplus < 201103L)) && \ + (G_GNUC_CHECK_VERSION(4, 8) || defined(__clang__)) #define glib_typeof(t) __typeof__ (t) -#elif defined(__cplusplus) && __cplusplus >= 201103L && GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68 +#elif defined(__cplusplus) && \ + (__cplusplus >= 201103L || (defined (_MSVC_LANG) && _MSVC_LANG > 201103L)) && \ + GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68 /* C++11 decltype() is close enough for our usage */ #include #define glib_typeof(t) typename std::remove_reference::type