summaryrefslogtreecommitdiff
path: root/lib/setup.h
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-08-16 01:33:59 +0000
committerYang Tse <yangsita@gmail.com>2008-08-16 01:33:59 +0000
commitad638da2c29a61babb50fdced0333393416a199a (patch)
tree5956d0f5515251212742ec9ff0c9d01088a295d7 /lib/setup.h
parenta923d8541c938aedd36d1c39a9bacf3e2a9eec10 (diff)
downloadcurl-ad638da2c29a61babb50fdced0333393416a199a.tar.gz
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
Diffstat (limited to 'lib/setup.h')
-rw-r--r--lib/setup.h29
1 files changed, 20 insertions, 9 deletions
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
/*