From: Gisle Vanem Date: Fri, 13 Jan 2023 13:51:55 +0000 (+0100) Subject: libtest: add a sleep macro for Windows X-Git-Tag: curl-7_88_0~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62097a7ea4e17ab09fe33086c0d63492710be1b4;p=thirdparty%2Fcurl.git libtest: add a sleep macro for Windows .. because sleep() is used in some libtests. Closes https://github.com/curl/curl/pull/10295 --- diff --git a/tests/libtest/lib1515.c b/tests/libtest/lib1515.c index 7bad1c2de7..d210ed3bed 100644 --- a/tests/libtest/lib1515.c +++ b/tests/libtest/lib1515.c @@ -37,10 +37,6 @@ #define DNS_TIMEOUT 1 -#if defined(WIN32) || defined(_WIN32) -#define sleep(sec) Sleep ((sec)*1000) -#endif - static int debug_callback(CURL *curl, curl_infotype info, char *msg, size_t len, void *ptr) { diff --git a/tests/libtest/lib1542.c b/tests/libtest/lib1542.c index 32233f775b..2570ea3cf6 100644 --- a/tests/libtest/lib1542.c +++ b/tests/libtest/lib1542.c @@ -36,10 +36,6 @@ #include "warnless.h" #include "memdebug.h" -#if defined(WIN32) || defined(_WIN32) -#define sleep(sec) Sleep ((sec)*1000) -#endif - int test(char *URL) { CURL *easy = NULL; diff --git a/tests/libtest/test.h b/tests/libtest/test.h index a120a5bed2..65c44ff834 100644 --- a/tests/libtest/test.h +++ b/tests/libtest/test.h @@ -42,6 +42,10 @@ #include "curl_printf.h" +#ifdef WIN32 +#define sleep(sec) Sleep ((sec)*1000) +#endif + #define test_setopt(A,B,C) \ if((res = curl_easy_setopt((A), (B), (C))) != CURLE_OK) \ goto test_cleanup