[sdl2]: Fix build error on android ndk r27 (#40510)

This commit is contained in:
Sandy 2024-08-19 12:53:41 -04:00 committed by GitHub
parent 3d23d8f278
commit f2ea3e0789
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 21 additions and 1 deletions

13
ports/sdl2/poll-fix.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/src/sensor/android/SDL_androidsensor.c b/src/sensor/android/SDL_androidsensor.c
index 3f57253cd..c06faf2ee 100644
--- a/src/sensor/android/SDL_androidsensor.c
+++ b/src/sensor/android/SDL_androidsensor.c
@@ -161,7 +161,7 @@ static void SDL_ANDROID_SensorUpdate(SDL_Sensor *sensor)
ASensorEvent event;
struct android_poll_source *source;
- if (ALooper_pollAll(0, NULL, &events, (void **)&source) == LOOPER_ID_USER) {
+ if (ALooper_pollOnce(0, NULL, &events, (void **)&source) == LOOPER_ID_USER) {
SDL_zero(event);
while (ASensorEventQueue_getEvents(sensor->hwdata->eventqueue, &event, 1) > 0) {
SDL_PrivateSensorUpdate(sensor, 0, event.data, SDL_arraysize(event.data));

View File

@ -8,6 +8,7 @@ vcpkg_from_github(
deps.patch
alsa-dep-fix.patch
cxx-linkage-pkgconfig.diff
poll-fix.patch # Remove with next version (2.30.7).
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SDL_STATIC)

View File

@ -1,6 +1,7 @@
{
"name": "sdl2",
"version": "2.30.6",
"port-version": 1,
"description": "Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.",
"homepage": "https://www.libsdl.org/download-2.0.php",
"license": "Zlib",

View File

@ -8070,7 +8070,7 @@
},
"sdl2": {
"baseline": "2.30.6",
"port-version": 0
"port-version": 1
},
"sdl2-gfx": {
"baseline": "1.0.4",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "35851962eb04c90f32822e7574ae69265113d88b",
"version": "2.30.6",
"port-version": 1
},
{
"git-tree": "0ddd2439efece30735786a3530fced0bb645c0af",
"version": "2.30.6",