+2024-07-13 Bruno Haible <bruno@clisp.org>
+
+ stdlib: Support use of clang++ on Ubuntu.
+ * lib/stdlib.in.h: Ignore __need_system_stdlib_h when GCC's
+ c++/11/stdlib.h is being included or has been included.
+
2024-07-10 Pip Cet <pipcet@protonmail.com>
timespec-sub: Fix compilation error on clang.
#endif
@PRAGMA_COLUMNS@
-#if defined __need_system_stdlib_h || defined __need_malloc_and_calloc
+#if (defined __need_system_stdlib_h && !defined _GLIBCXX_STDLIB_H) || defined __need_malloc_and_calloc
/* Special invocation conventions inside some gnulib header files,
- and inside some glibc header files, respectively. */
+ and inside some glibc header files, respectively.
+ Do not recognize this special invocation convention when GCC's
+ c++/11/stdlib.h is being included or has been included. This is needed
+ to support the use of clang+llvm binaries on Ubuntu 22.04 with
+ CXX="$clangdir/bin/clang++ -I/usr/include/c++/11 \
+ -I/usr/include/x86_64-linux-gnu/c++/11
+ -L/usr/lib/gcc/x86_64-linux-gnu/11
+ -Wl,-rpath,$clangdir/lib"
+ because in this case /usr/include/c++/11/stdlib.h (which does not support
+ the convention) is seen before the gnulib-generated stdlib.h. */
#@INCLUDE_NEXT@ @NEXT_STDLIB_H@