[libcxx-commits] [libcxx] Guard ..._REMOVED_UNCAUGHT_EXCEPTION behind ifndef (PR #106719)

Danial Klimkin via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 30 05:35:13 PDT 2024


https://github.com/dklimkin created https://github.com/llvm/llvm-project/pull/106719

Resolves "macro redefined" error when _LIBCPP_ENABLE_CXX20_REMOVED_UNCAUGHT_EXCEPTION is also set on command line by a build system.

>From 9cfc2765408918da7fb7760ae43b2d11f1d90024 Mon Sep 17 00:00:00 2001
From: Danial Klimkin <dklimkin at google.com>
Date: Fri, 30 Aug 2024 14:34:03 +0200
Subject: [PATCH] Guard ..._REMOVED_UNCAUGHT_EXCEPTION behind ifndef

Resolves "macro redefined" error when _LIBCPP_ENABLE_CXX20_REMOVED_UNCAUGHT_EXCEPTION is also set on command line by a build system.
---
 libcxx/src/exception.cpp | 2 ++
 1 file changed, 2 insertions(+)

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



More information about the libcxx-commits mailing list