From 52aa67723ad0cd8860872405396e1383aa1dda4e Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Wed, 28 Aug 2024 22:24:30 -0700 Subject: [PATCH] build: set _GNU_SOURCE for Adroid --- ggml/src/CMakeLists.txt | 2 +- ggml/src/ggml.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/ggml/src/CMakeLists.txt b/ggml/src/CMakeLists.txt index ff84b9bb5..ec7d30825 100644 --- a/ggml/src/CMakeLists.txt +++ b/ggml/src/CMakeLists.txt @@ -1247,7 +1247,7 @@ endif() # Data types, macros and functions related to controlling CPU affinity and # 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) endif() diff --git a/ggml/src/ggml.c b/ggml/src/ggml.c index 45dca68d4..fb14471f5 100644 --- a/ggml/src/ggml.c +++ b/ggml/src/ggml.c @@ -144,10 +144,6 @@ static int sched_yield (void) { } #else -#ifndef __USE_GNU -#define __USE_GNU -#endif - #include #include #include