From 7060b9b082e5726d4cc0974d9cb11dd20694c47a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 25 Sep 2024 09:38:07 +0200 Subject: [PATCH] build: fix cross-compile check for poll with bionic Since it seems the _POSIX_C_SOURCE "trick" does not work there, the check does not find poll(). Fixes #15013 Reported-by: vvb2060 on github Closes #15037 --- CMake/OtherTests.cmake | 3 ++- m4/curl-functions.m4 | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMake/OtherTests.cmake b/CMake/OtherTests.cmake index 8936cea016..e6e64bb7d5 100644 --- a/CMake/OtherTests.cmake +++ b/CMake/OtherTests.cmake @@ -95,7 +95,8 @@ if(NOT APPLE) #include int main(void) { - #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L + #if defined(__BIONIC__) || \ + defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L (void)poll(0, 0, 0); #else #error force compilation error diff --git a/m4/curl-functions.m4 b/m4/curl-functions.m4 index 2534fc5b46..851d50977f 100644 --- a/m4/curl-functions.m4 +++ b/m4/curl-functions.m4 @@ -3497,7 +3497,8 @@ AC_DEFUN([CURL_CHECK_FUNC_POLL], [ AC_LANG_PROGRAM([[ $curl_includes_stdlib ]],[[ - #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L + #if defined(__BIONIC__) || \ + (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) return 0; #else #error force compilation error -- 2.47.3