From 62097a7ea4e17ab09fe33086c0d63492710be1b4 Mon Sep 17 00:00:00 2001 From: Gisle Vanem Date: Fri, 13 Jan 2023 14:51:55 +0100 Subject: [PATCH] libtest: add a sleep macro for Windows .. because sleep() is used in some libtests. Closes https://github.com/curl/curl/pull/10295 --- tests/libtest/lib1515.c | 4 ---- tests/libtest/lib1542.c | 4 ---- tests/libtest/test.h | 4 ++++ 3 files changed, 4 insertions(+), 8 deletions(-) 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 -- 2.47.2