Skip to content

Commit b30e429

Browse files
committed
[libcxx] [test] Avoid conflicting definitions of _CRT_SECURE_NO_WARNINGS
This is defined both by libcxx/utils/libcxx/test/config.py (for any windows target) and msvc_stdlib_force_include.h (when testing specifically the MSVC C++ library). The command line define (-D_CRT_SECURE_NO_WARNINGS) defines it to the value 1; change the header define to match that. Keeping both instances, to keep the fix for cases when not building in cases that don't use config.py. Also remove a comment about whether this can be removed; it can't at least be removed altogether - doing that breaks a number of tests that otherwise succeed. Differential Revision: https://reviews.llvm.org/D89588
1 parent 38b632c commit b30e429

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

libcxx/test/support/msvc_stdlib_force_include.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#ifndef _LIBCXX_IN_DEVCRT
1616
// Silence warnings about CRT machinery.
17-
#define _CRT_SECURE_NO_WARNINGS
17+
#define _CRT_SECURE_NO_WARNINGS 1
1818

1919
// Avoid assertion dialogs.
2020
#define _CRT_SECURE_INVALID_PARAMETER(EXPR) ::abort()

libcxx/utils/libcxx/test/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ def configure_compile_flags(self):
272272
compile_flags_str = self.get_lit_conf('compile_flags', '')
273273
self.cxx.compile_flags += shlex.split(compile_flags_str)
274274
if self.target_info.is_windows():
275-
# FIXME: Can we remove this?
276275
self.cxx.compile_flags += ['-D_CRT_SECURE_NO_WARNINGS']
277276
# Don't warn about using common but nonstandard unprefixed functions
278277
# like chdir, fileno.

0 commit comments

Comments
 (0)