[libcxx-commits] [libcxx] [libc++] Avoid redefining _LIBCPP_DISABLE_DEPRECATION_WARNINGS if already defined. (PR #107340)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Sep 4 18:27:46 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: atul (atulkatti)

<details>
<summary>Changes</summary>

The following commit defines LIBCPP_DISABLE_DEPRECATION_WARNINGS to libcxx/src/exception.cpp
https://github.com/llvm/llvm-project/commit/1e9c654671d32bdeed867d16889f6451135cdbdb

However, Edge builds already built with LIBCPP_DISABLE_DEPRECATION_WARNINGS as we work towards removing some deprecated functions usage. This results in macro redefinition errors. This PR checks that the macro isn't defined already to avoid redefinition.

---
Full diff: https://github.com/llvm/llvm-project/pull/107340.diff


1 Files Affected:

- (modified) libcxx/src/exception.cpp (+3) 


``````````diff
diff --git a/libcxx/src/exception.cpp b/libcxx/src/exception.cpp
index ac6324cd9fe355..bbfb761595640a 100644
--- a/libcxx/src/exception.cpp
+++ b/libcxx/src/exception.cpp
@@ -7,7 +7,10 @@
 //===----------------------------------------------------------------------===//
 
 #define _LIBCPP_ENABLE_CXX20_REMOVED_UNCAUGHT_EXCEPTION
+
+#ifndef _LIBCPP_DISABLE_DEPRECATION_WARNINGS
 #define _LIBCPP_DISABLE_DEPRECATION_WARNINGS
+#endif
 
 #include <exception>
 #include <new>

``````````

</details>


https://github.com/llvm/llvm-project/pull/107340


More information about the libcxx-commits mailing list