Skip to content

Commit

Permalink
Fix android compilation with ndk older than r19
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
edo9300 committed Sep 6, 2024
1 parent 59896f5 commit c4c1617
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions gframe/Android/COSAndroidOperator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,19 @@
#endif

#include <sys/utsname.h>
#include <android/ndk-version.h>
#if __NDK_MAJOR__ >= 19
#include <android/api-level.h>
#else
#include <sys/system_properties.h>
#include <cstdlib>
static inline int android_get_device_api_level() {
char value[92] = { 0 };
if (__system_property_get("ro.build.version.sdk", value) < 1) return -1;
int api_level = std::atoi(value);
return (api_level > 0) ? api_level : -1;
}
#endif
#include "COSAndroidOperator.h"
#include "porting_android.h"

Expand Down

0 comments on commit c4c1617

Please sign in to comment.