Skip to content

Commit c7d7115

Browse files
committed
[android] Remove dependency from SwiftShims to Libc
Seems that SwiftShims cannot import some system headers (checked by a test in test/ParseableInterface/ModuleCache/SystemDependencies). So adding <android/api-level.h> is not going to work. The change reproduces the only piece necessary from the header, which is interpreting that if no __ANDROID_API__ is defined, the level should be the maximum allowed.
1 parent 3954a4a commit c7d7115

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

stdlib/public/SwiftShims/LibcShims.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
#include "SwiftStddef.h"
2424
#include "Visibility.h"
2525

26-
#if defined(__ANDROID__)
27-
#include <android/api-level.h>
28-
#endif
29-
3026
#if __has_feature(nullability)
3127
#pragma clang assume_nonnull begin
3228
#endif
@@ -112,7 +108,7 @@ static inline __swift_size_t _swift_stdlib_malloc_size(const void *ptr) {
112108
|| defined(__HAIKU__) || defined(__FreeBSD__)
113109
static inline __swift_size_t _swift_stdlib_malloc_size(const void *ptr) {
114110
#if defined(__ANDROID__)
115-
#if __ANDROID_API__ >= 17
111+
#if !defined(__ANDROID_API__) || __ANDROID_API__ >= 17
116112
extern __swift_size_t malloc_usable_size(const void *ptr);
117113
#endif
118114
#else

0 commit comments

Comments
 (0)