From 417dcb145b1084c239ee5efe2c96fcce373e0170 Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Thu, 13 Jun 2024 14:17:24 +0800 Subject: [PATCH] feat fix have timeval --- third_party/curl/CMake/OtherTests.cmake | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/third_party/curl/CMake/OtherTests.cmake b/third_party/curl/CMake/OtherTests.cmake index 7701c0e..7dc1c2f 100644 --- a/third_party/curl/CMake/OtherTests.cmake +++ b/third_party/curl/CMake/OtherTests.cmake @@ -72,6 +72,19 @@ check_c_source_compiles("${_source_epilogue} (void)ts; return 0; }" HAVE_STRUCT_TIMEVAL) +if (HAVE_SYS_TIME_H) +check_c_source_compiles("${_source_epilogue} + #include + int main(void) + { + struct timeval ts; + ts.tv_sec = 0; + ts.tv_usec = 0; + (void)ts; + return 0; + }" HAVE_STRUCT_TIMEVAL_BY_SYS_TIMEVAL) + set(HAVE_STRUCT_TIMEVAL ${HAVE_STRUCT_TIMEVAL_BY_SYS_TIMEVAL}) +endif() unset(CMAKE_TRY_COMPILE_TARGET_TYPE)