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
This commit is contained in:
Daniel Stenberg 2024-09-25 09:38:07 +02:00
parent da94b02372
commit 7060b9b082
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 4 additions and 2 deletions

View 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

View 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