mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-26 03:15:19 +00:00
Add option to disable __deallocate #warning
From r229162: Visual Studio's SAL extension uses a macro named __deallocate. This macro is used pervasively Using -Werror when building for Windows can force the use of -Wno-#warnings specifically because of this __deallocate #warning. Instead of forcing builds to disable all #warnings, this option allows libc++ to be built without this particular warning, while leaving other #warnings enabled. Patch by Dave Lee! llvm-svn: 275172
This commit is contained in:
parent
92aa427bb8
commit
6fe307334f
@ -135,6 +135,7 @@ option(LIBCXX_HAS_PTHREAD_API "Ignore auto-detection and force use of pthread AP
|
||||
# about #include_next which is used everywhere.
|
||||
option(LIBCXX_ENABLE_PEDANTIC "Compile with pedantic enabled." OFF)
|
||||
option(LIBCXX_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
|
||||
option(LIBCXX_DISABLE_MACRO_CONFLICT_WARNINGS "Disable #warnings about conflicting macros." OFF)
|
||||
|
||||
option(LIBCXX_GENERATE_COVERAGE "Enable generating code coverage." OFF)
|
||||
set(LIBCXX_COVERAGE_LIBRARY "" CACHE STRING
|
||||
@ -323,6 +324,9 @@ endif()
|
||||
if (LIBCXX_ENABLE_PEDANTIC)
|
||||
add_compile_flags_if_supported(-pedantic)
|
||||
endif()
|
||||
if (LIBCXX_DISABLE_MACRO_CONFLICT_WARNINGS)
|
||||
add_definitions(-D_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS)
|
||||
endif()
|
||||
|
||||
# Exception flags =============================================================
|
||||
if (LIBCXX_ENABLE_EXCEPTIONS)
|
||||
|
@ -9,10 +9,12 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifdef __deallocate
|
||||
#if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS)
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
_LIBCPP_WARNING("macro __deallocate is incompatible with C++. #undefining __deallocate")
|
||||
#else
|
||||
#warning: macro __deallocate is incompatible with C++. #undefining __deallocate
|
||||
#endif
|
||||
#endif
|
||||
#undef __deallocate
|
||||
#endif
|
||||
|
@ -9,21 +9,25 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifdef min
|
||||
#if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS)
|
||||
#if defined(_MSC_VER) && ! defined(__clang__)
|
||||
_LIBCPP_WARNING("macro min is incompatible with C++. Try #define NOMINMAX "
|
||||
"before any Windows header. #undefing min")
|
||||
#else
|
||||
#warning: macro min is incompatible with C++. #undefing min
|
||||
#endif
|
||||
#endif
|
||||
#undef min
|
||||
#endif
|
||||
|
||||
#ifdef max
|
||||
#if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS)
|
||||
#if defined(_MSC_VER) && ! defined(__clang__)
|
||||
_LIBCPP_WARNING("macro max is incompatible with C++. Try #define NOMINMAX "
|
||||
"before any Windows header. #undefing max")
|
||||
#else
|
||||
#warning: macro max is incompatible with C++. #undefing max
|
||||
#endif
|
||||
#endif
|
||||
#undef max
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user