]> granicus.if.org Git - curl/commitdiff
tests: fix libhostname visibility
authorPeter Wu <peter@lekensteyn.nl>
Thu, 6 Nov 2014 00:32:42 +0000 (01:32 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 10 Nov 2014 08:06:48 +0000 (09:06 +0100)
I noticed that a patched cmake build would pass tests with a fake local
hostname, but the autotools build skips them:

    got unexpected host name back, LD_PRELOAD failed

It turns out that -fvisibility=hidden hides the symbol, and since the
tests are not part of libcurl, it fails too. Just remove the LIBCURL
guard.

Broken since cURL 7.30 (commit 83a42ee20ea7fc25abb61c0b7ef56ebe712d7093,
"curl.h: stricter CURL_EXTERN linkage decorations logic").

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
tests/libtest/sethostname.h

index 192f037abb25de62131dbc8caadfd21db72b072f..032eaa078684b80081585ef18710044d1db0a10b 100644 (file)
 #ifdef CURL_STATICLIB
 #  define LIBHOSTNAME_EXTERN
 #elif defined(WIN32) || defined(__SYMBIAN32__)
-#  if defined(BUILDING_LIBCURL)
-#    define LIBHOSTNAME_EXTERN  __declspec(dllexport)
-#  else
-#    define LIBHOSTNAME_EXTERN  __declspec(dllimport)
-#  endif
-#elif defined(BUILDING_LIBCURL) && defined(CURL_HIDDEN_SYMBOLS)
+#  define LIBHOSTNAME_EXTERN  __declspec(dllexport)
+#elif defined(CURL_HIDDEN_SYMBOLS)
 #  define LIBHOSTNAME_EXTERN CURL_EXTERN_SYMBOL
 #else
 #  define LIBHOSTNAME_EXTERN