mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
libc++: fix compiling <locale> with -fmodules
In /usr/include/c++/v1/__locale_dir/locale_base_api.h, xlocale.h is
included without first including stdio.h and stdlib.h, which causes
functions like strtoll_l() or sscanf_l() to not be declared.
When compiling with -fmodules, locale_base_api.h is processed separately
due to a declaration in /usr/include/c++/v1/module.modulemap, and this
will cause errors due to the above undeclared symbols.
Meanwhile, upstream has substantially reorganized this part of libc++'s
headers, so apply a minimalistic workaround: specifically when compiling
with -fmodules, add includes of stdio.h and stdlib.h.
PR: 286342
Approved by: re (cperciva)
MFC after: 1 week
(cherry picked from commit c809b0184d)
(cherry picked from commit cab029073dc6cb5814df44556e585b8fdb1c9846)
This commit is contained in:
parent
93839cddbd
commit
a0d22d7934
1 changed files with 7 additions and 1 deletions
|
|
@ -25,7 +25,13 @@
|
|||
# include <__locale_dir/locale_base_api/fuchsia.h>
|
||||
#elif defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC)
|
||||
# include <__locale_dir/locale_base_api/musl.h>
|
||||
#elif defined(__APPLE__) || defined(__FreeBSD__)
|
||||
#elif defined(__APPLE__)
|
||||
# include <xlocale.h>
|
||||
#elif defined(__FreeBSD__)
|
||||
# if __has_feature(modules)
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# endif
|
||||
# include <xlocale.h>
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue