aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-08-08 16:29:01 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2021-08-11 21:54:16 +0300
commit0b97d585480e973d8b149618901f7a4ddfa1a906 (patch)
tree6d7641e277f9c7570a377635c1b5312f58aa535e /docs/markdown/snippets
parent042adba204adeb8599e6ce516e0615f9a7b1f9c0 (diff)
downloadmeson-0b97d585480e973d8b149618901f7a4ddfa1a906.zip
meson-0b97d585480e973d8b149618901f7a4ddfa1a906.tar.gz
meson-0b97d585480e973d8b149618901f7a4ddfa1a906.tar.bz2
compilers/c++: Add MSVC option to make the __cplusplus define accurate
Otherwise it always returns the value for c++98, starting with MSVC 2017 15.7 or later. Earlier versions are not affected by this mis-feature
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r--docs/markdown/snippets/msvc_cplusplus_define.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/markdown/snippets/msvc_cplusplus_define.md b/docs/markdown/snippets/msvc_cplusplus_define.md
new file mode 100644
index 0000000..eabfbe8
--- /dev/null
+++ b/docs/markdown/snippets/msvc_cplusplus_define.md
@@ -0,0 +1,7 @@
+## MSVC now sets the __cplusplus #define accurately
+
+For reasons, MSVC will always return `199711L` for `__cplusplus`, even when a
+newer c++ standard is explicitly requested, unless you pass a specific option to
+the compiler for MSVC 2017 15.7 and newer. Older versions are unaffected by
+this. Meson now always sets the option if it is available, as it is unlikley
+that users want the default behavior.