Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -135,6 +135,7 @@ # 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_DEALLOCATE_MACRO_WARNING "Disable __deallocate macro #warning." OFF) option(LIBCXX_GENERATE_COVERAGE "Enable generating code coverage." OFF) set(LIBCXX_COVERAGE_LIBRARY "" CACHE STRING @@ -323,6 +324,9 @@ if (LIBCXX_ENABLE_PEDANTIC) add_compile_flags_if_supported(-pedantic) endif() +if (LIBCXX_DISABLE_DEALLOCATE_MACRO_WARNING) + add_definitions(-D_LIBCPP_DISABLE_DEALLOCATE_MACRO_WARNING) +endif() # Exception flags ============================================================= if (LIBCXX_ENABLE_EXCEPTIONS) Index: include/__undef___deallocate =================================================================== --- include/__undef___deallocate +++ include/__undef___deallocate @@ -12,7 +12,9 @@ #if defined(_MSC_VER) && !defined(__clang__) _LIBCPP_WARNING("macro __deallocate is incompatible with C++. #undefining __deallocate") #else +#if !defined(_LIBCPP_DISABLE_DEALLOCATE_MACRO_WARNING) #warning: macro __deallocate is incompatible with C++. #undefining __deallocate #endif +#endif #undef __deallocate #endif