[libcxx] [test] Define _CRT_STDIO_ISO_WIDE_SPECIFIERS while building tests
authorMartin Storsjö <martin@martin.st>
Mon, 2 Nov 2020 06:13:26 +0000 (08:13 +0200)
committerMartin Storsjö <martin@martin.st>
Tue, 23 Feb 2021 13:57:30 +0000 (15:57 +0200)
This matches how libc++ itself is built. This avoids errors due to
mismatch if linking libc++ statically.

Differential Revision: https://reviews.llvm.org/D97169

libcxx/utils/libcxx/test/config.py

index a10d439..e78303c 100644 (file)
@@ -272,6 +272,9 @@ class Configuration(object):
             # Don't warn about using common but nonstandard unprefixed functions
             # like chdir, fileno.
             self.cxx.compile_flags += ['-D_CRT_NONSTDC_NO_WARNINGS']
+            # Build the tests in the same configuration as libcxx itself,
+            # to avoid mismatches if linked statically.
+            self.cxx.compile_flags += ['-D_CRT_STDIO_ISO_WIDE_SPECIFIERS']
             # Required so that tests using min/max don't fail on Windows,
             # and so that those tests don't have to be changed to tolerate
             # this insanity.