mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +00:00
Fix the build with NDK r20.
NDK r20 provides a declaration of android_get_device_api_level() at API level 29, and an inline definition at older API levels. The latter conflicts with crashpad's definition, so stop defining it if the NDK is new enough. Bug: chromium:891999 Change-Id: If58542c9d6b5315f823f2509f168f2cb79141e3f Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1739512 Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
parent
70d10eb629
commit
08f070325e
@ -21,7 +21,7 @@
|
||||
|
||||
#include "dlfcn_internal.h"
|
||||
|
||||
#if __ANDROID_API__ < 29
|
||||
#if __NDK_MAJOR__ < 20
|
||||
|
||||
extern "C" {
|
||||
|
||||
@ -47,4 +47,4 @@ int android_get_device_api_level() {
|
||||
|
||||
} // extern "C"
|
||||
|
||||
#endif // __ANDROID_API__ < 29
|
||||
#endif // __NDK_MAJOR__ < 20
|
||||
|
@ -16,23 +16,24 @@
|
||||
#define CRASHPAD_COMPAT_ANDROID_ANDROID_API_LEVEL_H_
|
||||
|
||||
#include_next <android/api-level.h>
|
||||
#include <android/ndk-version.h>
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#if __ANDROID_API__ < 29
|
||||
#if __NDK_MAJOR__ < 20
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Returns the API level of the device or -1 if it can't be determined. This
|
||||
// function is provided by Bionic at API 29.
|
||||
// function is provided by NDK r20.
|
||||
int android_get_device_api_level();
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // __ANDROID_API__ < 29
|
||||
#endif // __NDK_MAJOR__ < 20
|
||||
|
||||
#endif // CRASHPAD_COMPAT_ANDROID_ANDROID_API_LEVEL_H_
|
||||
|
Loading…
x
Reference in New Issue
Block a user