build: set _GNU_SOURCE for Adroid

This commit is contained in:
Max Krasnyansky 2024-08-28 22:24:30 -07:00
parent 3b5f7c2a9b
commit 52aa67723a
2 changed files with 1 additions and 5 deletions

View file

@ -1247,7 +1247,7 @@ endif()
# Data types, macros and functions related to controlling CPU affinity and # Data types, macros and functions related to controlling CPU affinity and
# some memory allocation are available on Linux through GNU extensions in libc # some memory allocation are available on Linux through GNU extensions in libc
if (CMAKE_SYSTEM_NAME MATCHES "Linux") if (CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Android")
add_compile_definitions(_GNU_SOURCE) add_compile_definitions(_GNU_SOURCE)
endif() endif()

View file

@ -144,10 +144,6 @@ static int sched_yield (void) {
} }
#else #else
#ifndef __USE_GNU
#define __USE_GNU
#endif
#include <pthread.h> #include <pthread.h>
#include <stdatomic.h> #include <stdatomic.h>
#include <sched.h> #include <sched.h>