aboutsummaryrefslogtreecommitdiff
path: root/src/tool_setup.h
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2012-04-10 03:20:30 +0200
committerYang Tse <yangsita@gmail.com>2012-04-10 03:20:30 +0200
commite5c14674f0cd50d1dfc71e73894753f7bffa91ae (patch)
treec152af5468f603014c1f426425c97909ff933eb6 /src/tool_setup.h
parent6dba7608bf4b044a2cffb3fee52bfd5b96802ab1 (diff)
curl tool: make setup.h first header included in tool_setup.h again
Diffstat (limited to 'src/tool_setup.h')
-rw-r--r--src/tool_setup.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/tool_setup.h b/src/tool_setup.h
index 648b0f226..677f6e5c9 100644
--- a/src/tool_setup.h
+++ b/src/tool_setup.h
@@ -24,10 +24,33 @@
#define CURL_NO_OLDIES
-#include <curl/curl.h> /* external interface */
+/*
+ * setup.h may define preprocessor macros such as _FILE_OFFSET_BITS and
+ * _LARGE_FILES in order to support files larger than 2 GB. On platforms
+ * where this happens it is mandatory that these macros are defined before
+ * any system header file is included, otherwise file handling function
+ * prototypes will be misdeclared and curl tool may not build properly;
+ * therefore we must include setup.h before curl.h when building curl.
+ */
#include "setup.h" /* from the lib directory */
+/*
+ * Undefine macros intended for libcurl internal use only.
+ */
+
+#undef CURL_HIDDEN_SYMBOLS
+
+/*
+ * curl tool certainly uses libcurl's external interface.
+ */
+
+#include <curl/curl.h> /* external interface */
+
+/*
+ * Platform specific stuff.
+ */
+
#if defined(macintosh) && defined(__MRC__)
# define main(x,y) curl_main(x,y)
#endif