From c49e9683b85ba9d12cbb6eebc4ab2c8dba68fbdc Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sun, 8 Aug 2010 02:58:19 +0200 Subject: build: libhostname linkage adjustments followup --- tests/libtest/Makefile.am | 2 +- tests/libtest/sethostname.c | 4 ++-- tests/libtest/sethostname.h | 25 +++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 tests/libtest/sethostname.h (limited to 'tests/libtest') diff --git a/tests/libtest/Makefile.am b/tests/libtest/Makefile.am index e6a580054..0603c03e1 100644 --- a/tests/libtest/Makefile.am +++ b/tests/libtest/Makefile.am @@ -71,7 +71,7 @@ if NO_UNDEFINED UNDEF = -no-undefined endif -libhostname_la_SOURCES = sethostname.c +libhostname_la_SOURCES = sethostname.c sethostname.h libhostname_la_LIBADD = libhostname_la_DEPENDENCIES = diff --git a/tests/libtest/sethostname.c b/tests/libtest/sethostname.c index 9d9fae00b..3dabb8231 100644 --- a/tests/libtest/sethostname.c +++ b/tests/libtest/sethostname.c @@ -9,12 +9,12 @@ #include "setup.h" +#include "sethostname.h" + /* * we force our own host name, in order to make some tests machine independent */ -int gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen); - int gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen) { const char *force_hostname = getenv("CURL_GETHOSTNAME"); diff --git a/tests/libtest/sethostname.h b/tests/libtest/sethostname.h new file mode 100644 index 000000000..458a8f0cf --- /dev/null +++ b/tests/libtest/sethostname.h @@ -0,0 +1,25 @@ +/***************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + */ + +#if (defined(WIN32) || defined(__SYMBIAN32__)) && !defined(CURL_STATICLIB) +# if defined(BUILDING_LIBCURL) +# define LIBHOSTNAME_EXTERN __declspec(dllexport) +# else +# define LIBHOSTNAME_EXTERN __declspec(dllimport) +# endif +#else +# ifdef CURL_HIDDEN_SYMBOLS +# define LIBHOSTNAME_EXTERN CURL_EXTERN_SYMBOL +# else +# define LIBHOSTNAME_EXTERN +# endif +#endif + +LIBHOSTNAME_EXTERN int gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen); + -- cgit v1.2.3