diff --git a/configure.ac b/configure.ac index 8d5958a..4f150f3 100644 --- a/configure.ac +++ b/configure.ac @@ -90,7 +90,7 @@ case "$host" in RLS_CFLAGS="-DNDEBUG=1" CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0600" - LIBS="$LIBS -lws2_32 -lntdll -lwtsapi32" + LIBS="$LIBS -lws2_32 -lntdll -lwtsapi32 -lintl" AC_CONFIG_FILES(win/makegtkruntime.sh) @@ -314,6 +314,7 @@ AC_CHECK_HEADER(malloc.h, AC_DEFINE(HAVE_MALLOC_H,,[do we have malloc.h?])) AC_CHECK_FUNCS(getaddrinfo, AC_DEFINE(HAVE_GETADDRINFO) ) AC_CHECK_FUNC(vasprintf, AC_DEFINE(HAVE_VASPRINTF) ) AC_CHECK_FUNC(strtok_r, AC_DEFINE(HAVE_STRTOK_R) ) +AC_CHECK_FUNC(inet_ntop, AC_DEFINE(HAVE_INET_NTOP) ) PKG_CHECK_EXISTS diff --git a/src/include/lib3270/config.h.in b/src/include/lib3270/config.h.in index cad6fab..eac2bb8 100644 --- a/src/include/lib3270/config.h.in +++ b/src/include/lib3270/config.h.in @@ -44,6 +44,7 @@ #undef HAVE_SYSLOG #undef HAVE_DBUS #undef HAVE_VASPRINTF + #undef HAVE_INET_NTOP #undef HAVE_ICONV #undef ICONV_CONST diff --git a/src/lib3270/Makefile.in b/src/lib3270/Makefile.in index c6a8d47..934d3e3 100644 --- a/src/lib3270/Makefile.in +++ b/src/lib3270/Makefile.in @@ -76,7 +76,7 @@ HOST_CC=@HOST_CC@ LD=@CC@ CFLAGS=@CFLAGS@ @LIB3270_CFLAGS@ @LIBSSL_CFLAGS@ -LIBS=@LIBS@ @LIBSSL_LIBS@ +LIBS=@LIBS@ @LIBSSL_LIBS@ @LIBICONV@ LDFLAGS=@LDFLAGS@ #---[ Rules ]---------------------------------------------------------------------------- diff --git a/src/lib3270/util.c b/src/lib3270/util.c index b93dd29..106d0e4 100644 --- a/src/lib3270/util.c +++ b/src/lib3270/util.c @@ -113,6 +113,7 @@ int get_version_info(void) } // Convert a network address to a string. +#ifndef HAVE_INET_NTOP const char * inet_ntop(int af, const void *src, char *dst, socklen_t cnt) { union { @@ -150,6 +151,7 @@ const char * inet_ntop(int af, const void *src, char *dst, socklen_t cnt) return dst; } +#endif // HAVE_INET_NTOP // Decode a Win32 error number. LIB3270_EXPORT const char * lib3270_win32_strerror(int e) diff --git a/src/lib3270/w3miscc.h b/src/lib3270/w3miscc.h index 7eeebbb..9f7c508 100644 --- a/src/lib3270/w3miscc.h +++ b/src/lib3270/w3miscc.h @@ -16,7 +16,12 @@ * Miscellaneous Win32 functions. */ -#if defined(_WIN32) + #include + + #ifndef HAVE_INET_NTOP LIB3270_INTERNAL const char *inet_ntop(int af, const void *src, char *dst,socklen_t cnt); + #endif // HAVE_INET_NTOP + + #if defined(_WIN32) LIB3270_INTERNAL const char *win32_strerror(int e); -#endif + #endif // WIN32 -- libgit2 0.21.2