Skip to content

Commit

Permalink
Expose SYSPROP_SYSTEMVERSION to Libretro Android core. This fixes cra…
Browse files Browse the repository at this point in the history
…shes with targetSdk 29.
  • Loading branch information
Swordfish90 committed Aug 3, 2020
1 parent 9f7839c commit cbdb9cc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions libretro/libretro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <thread>
#include <atomic>
#include <vector>
#include <stdlib.h>

#include "base/timeutil.h"
#include "Common/ChunkFile.h"
Expand Down Expand Up @@ -32,6 +33,10 @@
#include "libretro/libretro.h"
#include "libretro/LibretroGraphicsContext.h"

#if PPSSPP_PLATFORM(ANDROID)
#include <sys/system_properties.h>
#endif

#define DIR_SEP "/"
#ifdef _WIN32
#define DIR_SEP_CHRS "/\\"
Expand Down Expand Up @@ -857,6 +862,15 @@ int System_GetPropertyInt(SystemProperty prop)
{
case SYSPROP_AUDIO_SAMPLE_RATE:
return SAMPLERATE;
#if PPSSPP_PLATFORM(ANDROID)
case SYSPROP_SYSTEMVERSION: {
char sdk[PROP_VALUE_MAX] = {0};
if (__system_property_get("ro.build.version.sdk", sdk) != 0) {
return atoi(sdk);
}
return -1;
}
#endif
default:
break;
}
Expand Down

0 comments on commit cbdb9cc

Please sign in to comment.