aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2006-06-12 20:33:04 +0000
committerDan Fandrich <dan@coneharvesters.com>2006-06-12 20:33:04 +0000
commit59582a9d9dccada1cdc492168e089dc91f17b4fe (patch)
tree4ba936dc78db87eb7859223ab4daa4fc7320eec6 /include
parent6246bbc6563eb328ee34df81bf99e95723dbea5e (diff)
Implemented --enable-hidden-symbols configure option to enable
-fvisibility=hidden on gcc >= 4.0. This reduces the size of the libcurl binary and speeds up dynamic linking by hiding all the internal symbols from the symbol table.
Diffstat (limited to 'include')
-rw-r--r--include/curl/curl.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/curl/curl.h b/include/curl/curl.h
index 94c4551e0..bd9236ed3 100644
--- a/include/curl/curl.h
+++ b/include/curl/curl.h
@@ -58,7 +58,17 @@ extern "C" {
#define CURL_EXTERN __declspec(dllimport)
#endif
#else
-#define CURL_EXTERN
+
+#ifdef CURL_HIDDEN_SYMBOLS
+/*
+ * On gcc >= 4 if -fvisibility=hidden is given then this is used to cause
+ * external definitions to be put into the shared library. It makes no
+ * difference to applications whether this is set or not, only the library.
+ */
+#define CURL_EXTERN __attribute__ ((visibility ("default")))
+#else
+#define CURL_EXTERN
+#endif
#endif
/*