Skip to content

Commit

Permalink
meson: define _UCRT_NOISY_NAN to workaround the non-constant NAN define
Browse files Browse the repository at this point in the history
Windows SDK 10.0.26100.0 defines the NAN macro in a non-constant manner.
This violates the C/C++ standard and breaks the compilation of
initializers with Clang.

See:
https://developercommunity.visualstudio.com/t/NAN-is-no-longer-compile-time-constant-i/10688907
  • Loading branch information
kasper93 committed Nov 17, 2024
1 parent dd5f206 commit e8fd7b8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ mswin_flags = ['-D_WIN32_WINNT=0x0A00', '-DWINVER=0x0A00', '-DUNICODE',
'-D_CRT_DECLARE_NONSTDC_NAMES', '-D_CRT_NONSTDC_NO_WARNINGS',
'-D_CRT_SECURE_NO_WARNINGS', '-DWINRT_NO_SOURCE_LOCATION']

# https://developercommunity.visualstudio.com/t/NAN-is-no-longer-compile-time-constant-i/10688907
mswin_flags += '-D_UCRT_NOISY_NAN'

if host_machine.system() == 'windows'
flags += [mswin_flags]
flags_c += ['-U__STRICT_ANSI__']
Expand Down

0 comments on commit e8fd7b8

Please sign in to comment.