[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / libcxx / include / __support / android / locale_bionic.h
blob30e345cf9ee1cff63aa26206ae0044e2e658ef7f
1 // -*- C++ -*-
2 //===-----------------------------------------------------------------------===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP___SUPPORT_ANDROID_LOCALE_BIONIC_H
11 #define _LIBCPP___SUPPORT_ANDROID_LOCALE_BIONIC_H
13 #if defined(__BIONIC__)
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
19 #include <stdlib.h>
20 #include <xlocale.h>
22 #ifdef __cplusplus
24 #endif
26 #if defined(__ANDROID__)
28 #include <android/api-level.h>
29 #if __ANDROID_API__ < 21
30 #include <__support/xlocale/__posix_l_fallback.h>
31 #endif
33 // If we do not have this header, we are in a platform build rather than an NDK
34 // build, which will always be at least as new as the ToT NDK, in which case we
35 // don't need any of the inlines below since libc provides them.
36 #if __has_include(<android/ndk-version.h>)
37 #include <android/ndk-version.h>
38 // In NDK versions later than 16, locale-aware functions are provided by
39 // legacy_stdlib_inlines.h
40 #if __NDK_MAJOR__ <= 16
41 #if __ANDROID_API__ < 21
42 #include <__support/xlocale/__strtonum_fallback.h>
43 #elif __ANDROID_API__ < 26
45 #if defined(__cplusplus)
46 extern "C" {
47 #endif
49 inline _LIBCPP_HIDE_FROM_ABI_C float strtof_l(const char* __nptr, char** __endptr, locale_t) {
50 return ::strtof(__nptr, __endptr);
53 inline _LIBCPP_HIDE_FROM_ABI_C double strtod_l(const char* __nptr, char** __endptr, locale_t) {
54 return ::strtod(__nptr, __endptr);
57 inline _LIBCPP_HIDE_FROM_ABI_C long strtol_l(const char* __nptr, char** __endptr, int __base, locale_t) {
58 return ::strtol(__nptr, __endptr, __base);
61 #if defined(__cplusplus)
63 #endif
65 #endif // __ANDROID_API__ < 26
67 #endif // __NDK_MAJOR__ <= 16
68 #endif // __has_include(<android/ndk-version.h>)
69 #endif // defined(__ANDROID__)
71 #endif // defined(__BIONIC__)
72 #endif // _LIBCPP___SUPPORT_ANDROID_LOCALE_BIONIC_H