-
Notifications
You must be signed in to change notification settings - Fork 15k
Remove workarounds for NDK versions before 2017's r16. #148879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-libcxx Author: None (enh-google) ChangesFull diff: https://github.com/llvm/llvm-project/pull/148879.diff 2 Files Affected:
diff --git a/libcxx/include/__locale_dir/locale_base_api.h b/libcxx/include/__locale_dir/locale_base_api.h
index 8dbc28e839839..9f3ce02a3af20 100644
--- a/libcxx/include/__locale_dir/locale_base_api.h
+++ b/libcxx/include/__locale_dir/locale_base_api.h
@@ -129,8 +129,6 @@
// will define those directly.
# if defined(_AIX) || defined(__MVS__)
# include <__locale_dir/locale_base_api/ibm.h>
-# elif defined(__ANDROID__)
-# include <__locale_dir/locale_base_api/android.h>
# elif defined(__OpenBSD__)
# include <__locale_dir/locale_base_api/openbsd.h>
# elif defined(__wasi__) || _LIBCPP_HAS_MUSL_LIBC
diff --git a/libcxx/include/__locale_dir/locale_base_api/android.h b/libcxx/include/__locale_dir/locale_base_api/android.h
deleted file mode 100644
index 36b8d93e1b228..0000000000000
--- a/libcxx/include/__locale_dir/locale_base_api/android.h
+++ /dev/null
@@ -1,45 +0,0 @@
-// -*- C++ -*-
-//===-----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_ANDROID_H
-#define _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_ANDROID_H
-
-#include <stdlib.h>
-
-// FIXME: Is this actually required?
-extern "C" {
-#include <xlocale.h>
-}
-
-#include <android/api-level.h>
-
-// If we do not have this header, we are in a platform build rather than an NDK
-// build, which will always be at least as new as the ToT NDK, in which case we
-// don't need any of the inlines below since libc provides them.
-#if __has_include(<android/ndk-version.h>)
-# include <android/ndk-version.h>
-// In NDK versions later than 16, locale-aware functions are provided by
-// legacy_stdlib_inlines.h
-# if __NDK_MAJOR__ <= 16
-# if __ANDROID_API__ < 26
-
-inline _LIBCPP_HIDE_FROM_ABI float strtof_l(const char* __nptr, char** __endptr, locale_t) {
- return ::strtof(__nptr, __endptr);
-}
-
-inline _LIBCPP_HIDE_FROM_ABI double strtod_l(const char* __nptr, char** __endptr, locale_t) {
- return ::strtod(__nptr, __endptr);
-}
-
-# endif // __ANDROID_API__ < 26
-
-# endif // __NDK_MAJOR__ <= 16
-#endif // __has_include(<android/ndk-version.h>)
-
-#endif // _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_ANDROID_H
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we move to the new base API since we're touching things anyways? I think it should be as simple as including <__locale_dir/support/bsd_like.h>.
where? i was assuming that the already in the file is the expected path for Android (since we'll already have been taking that anyway!). |
If Android is already taking the |
yeah, the other copy of this file (which i was going to clean up separately, so let me know if you'd prefer to have all the changes in one PR) doesn't have a so this code is actually still used in that copy (and in older versions of this copy), but it looks like your recent cleanup (363bfd6) accidentally made this dead code --- but that was the right thing to do anyway, so no-one noticed :-) (i'm only here because brad0 has been cleaning up various "we don't need that any more" Android hacks around the tree, and this was the only place i found that was testing for specific versions of the NDK, not because this caused any trouble.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thanks for explaining. Don't make any changes to __cxx03/*, these headers are frozen and shouldn't be modified (at least, not right now).
LGTM with green CI. Let's also give some time for @philnik777 to chime in again, but I think this should be pretty uncontroversial. Thanks a lot for the cleanup, this is appreciated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't realize Android defined __linux__. LGTM! I'm always happy when we can simplify our code.
ack. let me know if/when that changes and you'd like me to clean up the mess.
any time you see anything like this that you're curious about, feel free to reach out (i think you already know other Android folks too) ... no point leaving cruft lying around, and if it is non-obviously useful, we can at least try to add a better code comment to motivate it! |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/38318 Here is the relevant piece of the build log for the reference |
No description provided.