[libc-commits] [libc] [libc] customizable namespace 2/4 (PR #65471)

Guillaume Chatelet via libc-commits libc-commits at lists.llvm.org
Wed Sep 6 06:00:56 PDT 2023


https://github.com/gchatelet created https://github.com/llvm/llvm-project/pull/65471:

This implements the second step of https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079

Namely "Add a guard in `src/__support/common.h`"

>From 88948993c47e381cfa4cba87379077e4d813c4a4 Mon Sep 17 00:00:00 2001
From: Guillaume Chatelet <gchatelet at google.com>
Date: Wed, 6 Sep 2023 12:57:58 +0000
Subject: [PATCH] [libc] customizable namespace 2/4

This implements the second step of https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079

Namely "Add a guard in `src/__support/common.h`"
---
 libc/src/__support/common.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libc/src/__support/common.h b/libc/src/__support/common.h
index 1cdd6fe1a515e68..a6aaa4eb2c2287a 100644
--- a/libc/src/__support/common.h
+++ b/libc/src/__support/common.h
@@ -9,6 +9,10 @@
 #ifndef LLVM_LIBC_SUPPORT_COMMON_H
 #define LLVM_LIBC_SUPPORT_COMMON_H
 
+#ifndef LIBC_NAMESPACE
+#error "LIBC_NAMESPACE macro is not defined."
+#endif
+
 #include "src/__support/macros/attributes.h"
 #include "src/__support/macros/properties/architectures.h"
 



More information about the libc-commits mailing list