Mesa (main): meson: Use a C99 STDC_VERSION for flex

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 3 15:47:05 UTC 2022


Module: Mesa
Branch: main
Commit: 3cd320c5fa22e2828c019b4be7355baca27de052
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3cd320c5fa22e2828c019b4be7355baca27de052

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Thu Jun  2 09:26:54 2022 -0700

meson: Use a C99 STDC_VERSION for flex

Fixes: 8575d0e8 ("meson: modernize win_flex stdint.h logic")
Acked-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16839>

---

 meson.build | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 209b36c2717..dcac6374e9b 100644
--- a/meson.build
+++ b/meson.build
@@ -1925,7 +1925,10 @@ if build_machine.system() == 'windows'
 
   prog_flex_cpp = prog_flex
   # Convince win_flex to use <inttypes.h> for C++ files
-  prog_flex_cpp += '-D__STDC_VERSION__=201112'
+  # Note that we are using a C99 version here rather than C11,
+  # because using a C11 version can cause the MSVC CRT headers to define
+  # static_assert to _Static_assert, which breaks other parts of the CRT
+  prog_flex_cpp += '-D__STDC_VERSION__=199901'
 
   prog_bison = find_program('win_bison', required : false)
   if not prog_bison.found()



More information about the mesa-commit mailing list