aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-08-08 02:58:19 +0200
committerYang Tse <yangsita@gmail.com>2010-08-08 02:59:55 +0200
commitc49e9683b85ba9d12cbb6eebc4ab2c8dba68fbdc (patch)
tree19636bd61e730ad64f660653ce1345933bed00ab /tests/libtest
parent6ea043a504d4b3307def90d54f9474ae02e97372 (diff)
build: libhostname linkage adjustments followup
Diffstat (limited to 'tests/libtest')
-rw-r--r--tests/libtest/Makefile.am2
-rw-r--r--tests/libtest/sethostname.c4
-rw-r--r--tests/libtest/sethostname.h25
3 files changed, 28 insertions, 3 deletions
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);
+