]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
build: fix cross-compile check for poll with bionic
authorDaniel Stenberg <daniel@haxx.se>
Wed, 25 Sep 2024 07:38:07 +0000 (09:38 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 25 Sep 2024 21:41:17 +0000 (23:41 +0200)
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
m4/curl-functions.m4

index 8936cea0168d56264a34f60fb7531747bd414037..e6e64bb7d5fb860201dc242b459296866b56ced5 100644 (file)
@@ -95,7 +95,8 @@ if(NOT APPLE)
       #include <stdlib.h>
       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
index 2534fc5b467389dd8006718cdd38c5e5a9a5f044..851d50977fc5bf2d9b7ddd6c74835060c00afca3 100644 (file)
@@ -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