[libc++] fix macro redef warning when exception is disabled
authorWeiming Zhao <weimingz@codeaurora.org>
Thu, 21 Apr 2016 05:28:18 +0000 (05:28 +0000)
committerWeiming Zhao <weimingz@codeaurora.org>
Thu, 21 Apr 2016 05:28:18 +0000 (05:28 +0000)
Summary:
 when setting LIBCXX_ENABLE_EXCEPTIONS=false, _LIBCPP_NO_EXCEPTIONS wil be defined in both commandline and _config

Reviewers: bcraig, EricWF

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D19344

llvm-svn: 266956

libcxx/include/__config

index b82c708..a28a0a4 100644 (file)
@@ -297,7 +297,7 @@ typedef __char16_t char16_t;
 typedef __char32_t char32_t;
 #endif
 
-#if !(__has_feature(cxx_exceptions))
+#if !(__has_feature(cxx_exceptions)) && !defined(_LIBCPP_NO_EXCEPTIONS)
 #define _LIBCPP_NO_EXCEPTIONS
 #endif