build: Use C89 for the standard version check

The '90' version is for ISO C90, but Meson does not understand it. As
far as GCC and Clang are concerned, `-std=c89` is exactly the same as
`-std=c90`. As of VS 2017, MSVC supports `/std:c11` as the minimum
version of the C standard, with C89 (plus Microsoft extensions) being
the default.

See:

- GCC: https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gcc/C-Dialect-Options.html
- MSVC: https://learn.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version?view=msvc-170#c-standards-support-1
This commit is contained in:
Emmanuele Bassi 2024-05-16 14:23:12 +01:00
parent 62e27d2716
commit 1fb47422e9

View File

@ -14,7 +14,7 @@ fs = import('fs')
cc = meson.get_compiler('c')
c_standards = {}
foreach std : ['90', '99', '11', '17']
foreach std : ['89', '99', '11', '17']
arg = (cc.get_id() == 'msvc' ? '/std:' : '-std=') + 'c' + std
if cc.has_argument(arg)
c_standards += { std: arg }