[libcxx-commits] [libcxx] [libcxx] Include __llvm-libc-common.h if applicable (PR #156331)
William Huynh via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Sep 1 07:08:59 PDT 2025
https://github.com/saturn691 created https://github.com/llvm/llvm-project/pull/156331
Currently on embedded platforms, `<features.h>` is not being included. We need at least one of the LLVM-libc headers to be included, to have access to the define `__LLVM_LIBC__`. Therefore, as a temporary solution until #147956 is merged, we include a check for the LLVM-libc common header library.
>From 9ed9527dfde5e620fad4bbe8403e2857c0a458e8 Mon Sep 17 00:00:00 2001
From: William Huynh <William.Huynh at arm.com>
Date: Mon, 1 Sep 2025 15:06:54 +0100
Subject: [PATCH] [libcxx] Include __llvm-libc-common.h if applicable
---
libcxx/include/__configuration/platform.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libcxx/include/__configuration/platform.h b/libcxx/include/__configuration/platform.h
index f3c199dee172b..cf7d9d965cf30 100644
--- a/libcxx/include/__configuration/platform.h
+++ b/libcxx/include/__configuration/platform.h
@@ -49,6 +49,11 @@
# include <picolibc.h>
#endif
+// TODO: we should remove this once (#147956) is merged, for the same reason as listed above.
+#if __has_include(<__llvm-libc-common.h>)
+# include <__llvm-libc-common.h>
+#endif
+
#ifndef __BYTE_ORDER__
# error \
"Your compiler doesn't seem to define __BYTE_ORDER__, which is required by libc++ to know the endianness of your target platform"
More information about the libcxx-commits
mailing list