From b30e42922aeaeb70efbfcf7c2132dae21239a023 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20Storsj=C3=B6?= Date: Tue, 4 Feb 2020 22:51:06 +0200 Subject: [PATCH] [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 --- libcxx/test/support/msvc_stdlib_force_include.h | 2 +- libcxx/utils/libcxx/test/config.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/libcxx/test/support/msvc_stdlib_force_include.h b/libcxx/test/support/msvc_stdlib_force_include.h index 0869be3..bd83bee 100644 --- a/libcxx/test/support/msvc_stdlib_force_include.h +++ b/libcxx/test/support/msvc_stdlib_force_include.h @@ -14,7 +14,7 @@ #ifndef _LIBCXX_IN_DEVCRT // Silence warnings about CRT machinery. - #define _CRT_SECURE_NO_WARNINGS + #define _CRT_SECURE_NO_WARNINGS 1 // Avoid assertion dialogs. #define _CRT_SECURE_INVALID_PARAMETER(EXPR) ::abort() diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py index d32b0ee..0d21aa1 100644 --- a/libcxx/utils/libcxx/test/config.py +++ b/libcxx/utils/libcxx/test/config.py @@ -272,7 +272,6 @@ class Configuration(object): compile_flags_str = self.get_lit_conf('compile_flags', '') self.cxx.compile_flags += shlex.split(compile_flags_str) if self.target_info.is_windows(): - # FIXME: Can we remove this? self.cxx.compile_flags += ['-D_CRT_SECURE_NO_WARNINGS'] # Don't warn about using common but nonstandard unprefixed functions # like chdir, fileno. -- 2.7.4