Skip to content

Commit

Permalink
build: libhostname linkage adjustments followup
Browse files Browse the repository at this point in the history
  • Loading branch information
yangtse committed Aug 8, 2010
1 parent 6ea043a commit c49e968
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/libtest/Makefile.am
Expand Up @@ -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 =
Expand Down
4 changes: 2 additions & 2 deletions tests/libtest/sethostname.c
Expand Up @@ -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");
Expand Down
25 changes: 25 additions & 0 deletions 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);

0 comments on commit c49e968

Please sign in to comment.