curl_setup.h: add curl_uint64_t internal type

The unsigned version of curl_off_t basically
This commit is contained in:
Evgeny Grin 2024-02-10 19:28:27 +01:00 committed by Daniel Stenberg
parent ab027d9cbc
commit 30a3880f6b
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -266,6 +266,13 @@
#include <curl/system.h>
/* Helper macro to expand and concatenate two macros.
* Direct macros concatenation does not work because macros
* are not expanded before direct concatenation.
*/
#define CURL_CONC_MACROS_(A,B) A ## B
#define CURL_CONC_MACROS(A,B) CURL_CONC_MACROS_(A,B)
/* curl uses its own printf() function internally. It understands the GNU
* format. Use this format, so that is matches the GNU format attribute we
* use with the mingw compiler, allowing it to verify them at compile-time.
@ -495,6 +502,18 @@
#endif
#define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - CURL_OFF_T_C(1))
#if (SIZEOF_CURL_OFF_T != 8)
# error "curl_off_t must be exactly 64 bits"
#else
typedef unsigned CURL_TYPEOF_CURL_OFF_T curl_uint64_t;
# ifndef CURL_SUFFIX_CURL_OFF_TU
# error "CURL_SUFFIX_CURL_OFF_TU must be defined"
# endif
# define CURL_UINT64_SUFFIX CURL_SUFFIX_CURL_OFF_TU
# define CURL_UINT64_C(val) CURL_CONC_MACROS(val,CURL_UINT64_SUFFIX)
# define CURL_UINT64_CAST(expr) ((curl_uint64_t)(expr))
#endif
#if (SIZEOF_TIME_T == 4)
# ifdef HAVE_TIME_T_UNSIGNED
# define TIME_T_MAX UINT_MAX