mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 00:50:40 +00:00
Fix android compile errors on NDK 27+
ALooper_pollAll was obsoleted since NDK 27 and resulted in renderdoccmd_android.cpp:526:8: error: 'ALooper_pollAll' is unavailable: obsoleted in Android 1 - ALooper_pollAll may ignore wakes. Use ALooper_pollOnce instead. See The API documentation for more information Since we poll from within a loop, we can replace it by ALooper_pollOnce directly. But to be on the safe side, do this only on NDK 27+.
This commit is contained in:
committed by
Baldur Karlsson
parent
4f0e117359
commit
8552eec7a1
@@ -523,7 +523,11 @@ void android_main(struct android_app *state)
|
||||
}
|
||||
}
|
||||
|
||||
#if __NDK_MAJOR__ >= 27
|
||||
if(ALooper_pollOnce(1, nullptr, &events, (void **)&source) >= 0)
|
||||
#else
|
||||
if(ALooper_pollAll(1, nullptr, &events, (void **)&source) >= 0)
|
||||
#endif
|
||||
{
|
||||
if(source != NULL)
|
||||
source->process(android_state, source);
|
||||
|
||||
@@ -824,7 +824,11 @@ void android_main(struct android_app *state)
|
||||
android_poll_source *source;
|
||||
do
|
||||
{
|
||||
#if __NDK_MAJOR__ >= 27
|
||||
if(ALooper_pollOnce(1, nullptr, &events, (void **)&source) >= 0)
|
||||
#else
|
||||
if(ALooper_pollAll(1, nullptr, &events, (void **)&source) >= 0)
|
||||
#endif
|
||||
{
|
||||
if(source != NULL)
|
||||
source->process(android_state, source);
|
||||
|
||||
Reference in New Issue
Block a user