mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
gmacros: Define G_CXX_STD_VERSION and check macros
Sadly, in C++ there's not an universal way to get what language standard is used to compile GLib-based programs, in fact while most compilers relies on `__cplusplus`, MSVC is defining that, but it does not use it to expose such information (unless `/Zc:__cplusplus` arg is used). On the other side, MSVC reports the language standard via _MSVC_LANG [1]. This complication makes us defining some macros in a very complex way (such as glib_typeof()), because we need to perform many checks just to understand if a C++ compiler is used and what standard is expecting. To avoid this, define multiple macros that can be used to figure out what C++ standard is being used. [1] https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=msvc-170
This commit is contained in:
@@ -410,6 +410,10 @@ G_HAVE_GNUC_VISIBILITY
|
||||
G_GNUC_INTERNAL
|
||||
G_GNUC_MAY_ALIAS
|
||||
|
||||
<SUBSECTION>
|
||||
G_CXX_STD_VERSION
|
||||
G_CXX_STD_CHECK_VERSION
|
||||
|
||||
<SUBSECTION>
|
||||
G_DEPRECATED
|
||||
G_DEPRECATED_FOR
|
||||
|
Reference in New Issue
Block a user