Skip to content

Commit db2e0e7

Browse files
committed
[libc++] Check for _newlib_version.h in addition to picolibc.h
Fixes #152763. #131921 added some code to pull in a definition of _NEWLIB_VERSION if it exists. It does this by checking __has_include(<picolibc.h>) and including it if so. However, this does not work for systems that have newlib rather than picolibc. With this change, we check for either picolibc.h or _newlib_version.h, which works for both newlib and picolibc.
1 parent e92b7e9 commit db2e0e7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libcxx/include/__configuration/platform.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
// This is required in order for _NEWLIB_VERSION to be defined in places where we use it.
4646
// TODO: We shouldn't be including arbitrarily-named headers from libc++ since this can break valid
4747
// user code. Move code paths that need _NEWLIB_VERSION to another customization mechanism.
48-
#if __has_include(<picolibc.h>)
48+
#if __has_include(<_newlib_version.h>)
49+
# include <_newlib_version.h>
50+
#elif __has_include(<picolibc.h>)
4951
# include <picolibc.h>
5052
#endif
5153

0 commit comments

Comments
 (0)