From ad638da2c29a61babb50fdced0333393416a199a Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sat, 16 Aug 2008 01:33:59 +0000 Subject: Library internal only C preprocessor macros FORMAT_OFF_T and FORMAT_OFF_TU remain in use as internal curl_off_t print formatting strings for the internal *printf functions which still cannot handle print formatting string directives such as "I64d", "I64u", and others available on MSVC, MinGW, Intel's ICC, and other DOS/Windows compilers. This reverts previous commit part which did: FORMAT_OFF_T -> CURL_FORMAT_CURL_OFF_T FORMAT_OFF_TU -> CURL_FORMAT_CURL_OFF_TU --- lib/setup.h | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'lib/setup.h') diff --git a/lib/setup.h b/lib/setup.h index 538a0d529..7ae4d49c3 100644 --- a/lib/setup.h +++ b/lib/setup.h @@ -121,21 +121,32 @@ #endif /* - * Ensure that no one is using the old internal FORMAT_OFF_T macro + * Set up internal curl_off_t formatting string directives for + * exclusive use with libcurl's internal *printf functions. */ #ifdef FORMAT_OFF_T -# error "FORMAT_OFF_T shall not be defined!" - Error Compilation_aborted_FORMAT_OFF_T_shall_not_be_defined +# error "FORMAT_OFF_T shall not be defined before this point!" + Error Compilation_aborted_FORMAT_OFF_T_already_defined #endif -/* - * Ensure that no one is using the old internal FORMAT_OFF_TU macro - */ - #ifdef FORMAT_OFF_TU -# error "FORMAT_OFF_TU shall not be defined!" - Error Compilation_aborted_FORMAT_OFF_TU_shall_not_be_defined +# error "FORMAT_OFF_TU shall not be defined before this point!" + Error Compilation_aborted_FORMAT_OFF_TU_already_defined +#endif + +#if (CURL_SIZEOF_CURL_OFF_T > 4) +# if (CURL_SIZEOF_LONG > 4) +# define FORMAT_OFF_T "ld" +# else +# define FORMAT_OFF_T "lld" +# endif +#else +# if (CURL_SIZEOF_LONG > 2) +# define FORMAT_OFF_T "ld" +# else +# define FORMAT_OFF_T "lld" +# endif #endif /* -- cgit v1.2.3