Merge branch 'msvc-cxx-use-native-attribute-specifiers' into 'main'

gmacros: Use C++ namespaces attribute specifier sequences for msvc

See merge request GNOME/glib!3086
This commit is contained in:
Philip Withnall 2022-11-24 18:12:29 +00:00
commit 2ee44ba1d5

View File

@ -1157,7 +1157,11 @@
# endif
#elif defined (_MSC_VER)
/* Use MSVC specific syntax. */
# define G_ALWAYS_INLINE __forceinline
# if G_CXX_STD_CHECK_VERSION (11) && _MSC_VER >= 1927
# define G_ALWAYS_INLINE [[msvc::forceinline]]
# else
# define G_ALWAYS_INLINE __forceinline
# endif
#else
# define G_ALWAYS_INLINE /* empty */
#endif
@ -1197,6 +1201,12 @@
/* Use ISO C++11 syntax when the compiler supports it. */
# if defined (__GNUC__)
# define G_NO_INLINE [[gnu::noinline]]
# elif defined (_MSC_VER)
# if _MSC_VER >= 1927
# define G_NO_INLINE [[msvc::noinline]]
# else
# define G_NO_INLINE __declspec (noinline)
# endif
# endif
# else
# define G_NO_INLINE __attribute__ ((__noinline__))
@ -1204,7 +1214,11 @@
#elif defined (_MSC_VER) && (1200 <= _MSC_VER)
/* Use MSVC specific syntax. */
/* Use ISO C++11 syntax when the compiler supports it. */
# define G_NO_INLINE __declspec (noinline)
# if G_CXX_STD_CHECK_VERSION (11) && _MSC_VER >= 1927
# define G_NO_INLINE [[msvc::noinline]]
# else
# define G_NO_INLINE __declspec (noinline)
# endif
#else
# define G_NO_INLINE /* empty */
#endif