mirror of
https://github.com/curl/curl.git
synced 2026-08-26 16:23:32 +03:00
curltime: use libcurl time functions in src and tests/server
The curl tool and tests/server used 2 parallel implementations of libcurl's `Curl_now()` and `Curl_timediff()` functions. Make them use the libcurl one. Closes #16653
This commit is contained in:
parent
b1faac8039
commit
436d4a360a
20 changed files with 129 additions and 292 deletions
|
|
@ -28,6 +28,18 @@
|
|||
|
||||
#include "timediff.h"
|
||||
|
||||
#ifndef BUILDING_LIBCURL
|
||||
/* this renames the functions so that the tool code can use the same code
|
||||
without getting symbol collisions */
|
||||
#define Curl_now curlx_now
|
||||
#define Curl_timediff(a,b) curlx_timediff(a,b)
|
||||
#define Curl_timediff_ceil(a,b) curlx_timediff_ceil(a,b)
|
||||
#define Curl_timediff_us(a,b) curlx_timediff_us(a,b)
|
||||
|
||||
/* For tool or tests, we must initialize before calling Curl_now() */
|
||||
void curlx_now_init(void);
|
||||
#endif
|
||||
|
||||
struct curltime {
|
||||
time_t tv_sec; /* seconds */
|
||||
int tv_usec; /* microseconds */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue