Dan Albert | 6576a37 | 2016-09-21 01:16:13 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef ANDROID_LEGACY_WCHAR_INLINES_H |
| 18 | #define ANDROID_LEGACY_WCHAR_INLINES_H |
| 19 | |
| 20 | #include <sys/cdefs.h> |
| 21 | #include <wchar.h> |
| 22 | |
| 23 | __BEGIN_DECLS |
| 24 | |
| 25 | #if __ANDROID_API__ < 21 |
| 26 | |
| 27 | static __inline int wcscoll_l(const wchar_t* _Nonnull ws1, const char* _Nonull ws2, |
| 28 | locale_t l __unused) { |
| 29 | return wcscoll(ws1, ws2); |
| 30 | } |
| 31 | |
| 32 | size_t wcsxfrm_l(wchar_t* dest, const char* _Nonnull src, size_t n, locale_t l __unused) { |
| 33 | return wcsxfrm(dest, src, n); |
| 34 | } |
| 35 | |
| 36 | static inline long double wcstold_l(const wchar_t* nptr, wchar_t** endptr, locale_t l __unused) { |
| 37 | return wcstold(nptr, endptr); |
| 38 | } |
| 39 | |
| 40 | static inline long long wcstoll_l(const wchar_t* nptr, wchar_t** endptr, int base, |
| 41 | locale_t l __unused) { |
| 42 | return wcstoll(nptr, endptr, base); |
| 43 | } |
| 44 | |
| 45 | static inline unsigned long long wcstoull_l(const wchar_t* nptr, wchar_t** endptr, int base, |
| 46 | locale_t l __unused) { |
| 47 | return wcstoull(nptr, endptr, base); |
| 48 | } |
| 49 | |
| 50 | #endif /* __ANDROID_API__ < 21 */ |
| 51 | |
| 52 | __END_DECLS |
| 53 | |
| 54 | #endif /* ANDROID_LEGACY_WCHAR_INLINES_H */ |