Files
libcxx/include/support/android/locale_bionic.h
Louis Dionne 4e7ffcaae6 Revert "[libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY"
This reverts commit r336369. The commit had two problems:
1. __pbump was marked as _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY instead of
   _LIBCPP_INLINE_VISIBILITY, which lead to two symbols being added in the
   dylib and the check-cxx-abilist failing.

2. The LLDB tests started failing because they undefine
   `_LIBCPP_INLINE_VISIBILITY`. I need to figure out why they do that and
   fix the tests before we can go forward with this change.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@336382 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 18:41:50 +00:00

69 lines
1.7 KiB
C++

// -*- C++ -*-
//===------------------- support/android/locale_bionic.h ------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
#define _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
#if defined(__BIONIC__)
#ifdef __cplusplus
extern "C" {
#endif
#include <stdlib.h>
#include <xlocale.h>
#ifdef __cplusplus
}
#endif
#if defined(__ANDROID__)
#include <android/api-level.h>
#include <android/ndk-version.h>
#include <support/xlocale/__posix_l_fallback.h>
// In NDK versions later than 16, locale-aware functions are provided by
// legacy_stdlib_inlines.h
#if __NDK_MAJOR__ <= 16
#if __ANDROID_API__ < 21
#include <support/xlocale/__strtonum_fallback.h>
#elif __ANDROID_API__ < 26
#if defined(__cplusplus)
extern "C" {
#endif
inline _LIBCPP_ALWAYS_INLINE float strtof_l(const char* __nptr, char** __endptr,
locale_t) {
return ::strtof(__nptr, __endptr);
}
inline _LIBCPP_ALWAYS_INLINE double strtod_l(const char* __nptr,
char** __endptr, locale_t) {
return ::strtod(__nptr, __endptr);
}
inline _LIBCPP_ALWAYS_INLINE long strtol_l(const char* __nptr, char** __endptr,
int __base, locale_t) {
return ::strtol(__nptr, __endptr, __base);
}
#if defined(__cplusplus)
}
#endif
#endif // __ANDROID_API__ < 26
#endif // __NDK_MAJOR__ <= 16
#endif // defined(__ANDROID__)
#endif // defined(__BIONIC__)
#endif // _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H