[llvm] 4a44e00 - [llvm] Define __has_warning in Compiler.h if it isn't defined
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Wed May 28 11:13:00 PDT 2025
Author: Nico Weber
Date: 2025-05-28T14:12:36-04:00
New Revision: 4a44e0014d1b79089d42ef86f0d989053df0cbea
URL: https://github.com/llvm/llvm-project/commit/4a44e0014d1b79089d42ef86f0d989053df0cbea
DIFF: https://github.com/llvm/llvm-project/commit/4a44e0014d1b79089d42ef86f0d989053df0cbea.diff
LOG: [llvm] Define __has_warning in Compiler.h if it isn't defined
Follow-up to #141091.
Added:
Modified:
llvm/include/llvm/Support/Compiler.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Support/Compiler.h b/llvm/include/llvm/Support/Compiler.h
index 89b925da75338..b4382057654ba 100644
--- a/llvm/include/llvm/Support/Compiler.h
+++ b/llvm/include/llvm/Support/Compiler.h
@@ -39,6 +39,10 @@
# define __has_builtin(x) 0
#endif
+#ifndef __has_warning
+# define __has_warning(x) 0
+#endif
+
// Only use __has_cpp_attribute in C++ mode. GCC defines __has_cpp_attribute in
// C mode, but the :: in __has_cpp_attribute(scoped::attribute) is invalid.
#ifndef LLVM_HAS_CPP_ATTRIBUTE
More information about the llvm-commits
mailing list