mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
explicitely test for ws2tcpip.h header, fix library detection on windows for inet_ntop with corrent library, guard includes and definitions with configure results, cleanup header inclusion
This commit is contained in:
parent
94e10f0447
commit
b879e0835b
5 changed files with 41 additions and 11 deletions
|
@ -785,6 +785,9 @@
|
||||||
/* Define to 1 if you have the <windows.h> header file. */
|
/* Define to 1 if you have the <windows.h> header file. */
|
||||||
#undef HAVE_WINDOWS_H
|
#undef HAVE_WINDOWS_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <ws2tcpip.h> header file. */
|
||||||
|
#undef HAVE_WS2TCPIP_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <zlib.h> header file. */
|
/* Define to 1 if you have the <zlib.h> header file. */
|
||||||
#undef HAVE_ZLIB_H
|
#undef HAVE_ZLIB_H
|
||||||
|
|
||||||
|
|
|
@ -56,12 +56,21 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
extern const char *inet_ntop(int, const void *, char *, size_t);
|
#ifdef HAVE_WS2TCPIP_H
|
||||||
extern int inet_pton(int , const char *, void *);
|
#include <ws2tcpip.h>
|
||||||
#define OPTLEN int
|
#endif // HAVE_WS2TCPIP_H
|
||||||
#else
|
|
||||||
#define OPTLEN socklen_t
|
#if !defined(HAVE_INET_NTOP)
|
||||||
#endif
|
extern const char *inet_ntop(int, const void *, char *, size_t);
|
||||||
|
#endif
|
||||||
|
#if !defined(HAVE_INET_NTOP)
|
||||||
|
extern int inet_pton(int , const char *, void *);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define OPTLEN int
|
||||||
|
#else // _WIN32
|
||||||
|
#define OPTLEN socklen_t
|
||||||
|
#endif // _WIN32
|
||||||
|
|
||||||
unsigned
|
unsigned
|
||||||
GSPrivateSockaddrLength(struct sockaddr *addr)
|
GSPrivateSockaddrLength(struct sockaddr *addr)
|
||||||
|
|
|
@ -39,17 +39,22 @@
|
||||||
#import "Foundation/NSCoder.h"
|
#import "Foundation/NSCoder.h"
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#include <winsock2.h>
|
#ifdef HAVE_WS2TCPIP_H
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
|
#endif // HAVE_WS2TCPIP_H
|
||||||
|
#if !defined(HAVE_INET_NTOP)
|
||||||
extern const char *inet_ntop(int, const void *, char *, size_t);
|
extern const char *inet_ntop(int, const void *, char *, size_t);
|
||||||
|
#endif
|
||||||
|
#if !defined(HAVE_INET_NTOP)
|
||||||
extern int inet_pton(int , const char *, void *);
|
extern int inet_pton(int , const char *, void *);
|
||||||
#else
|
#endif
|
||||||
|
#else /* !_WIN32 */
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif /* !_WIN32*/
|
#endif /* !_WIN32 */
|
||||||
|
|
||||||
#ifndef INADDR_NONE
|
#ifndef INADDR_NONE
|
||||||
#define INADDR_NONE -1
|
#define INADDR_NONE -1
|
||||||
|
|
14
configure
vendored
14
configure
vendored
|
@ -9721,6 +9721,18 @@ fi
|
||||||
# These used by GSFileHandle.m and distributed objects
|
# These used by GSFileHandle.m and distributed objects
|
||||||
# On some systems we need -lnsl ... so check for that case.
|
# On some systems we need -lnsl ... so check for that case.
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
|
for ac_header in ws2tcpip.h
|
||||||
|
do :
|
||||||
|
ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default"
|
||||||
|
if test "x$ac_cv_header_ws2tcpip_h" = xyes; then :
|
||||||
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
#define HAVE_WS2TCPIP_H 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntop" >&5
|
||||||
$as_echo_n "checking for library containing inet_ntop... " >&6; }
|
$as_echo_n "checking for library containing inet_ntop... " >&6; }
|
||||||
if ${ac_cv_search_inet_ntop+:} false; then :
|
if ${ac_cv_search_inet_ntop+:} false; then :
|
||||||
|
@ -9745,7 +9757,7 @@ return inet_ntop ();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
_ACEOF
|
_ACEOF
|
||||||
for ac_lib in '' nsl; do
|
for ac_lib in '' nsl Ws2_32; do
|
||||||
if test -z "$ac_lib"; then
|
if test -z "$ac_lib"; then
|
||||||
ac_res="none required"
|
ac_res="none required"
|
||||||
else
|
else
|
||||||
|
|
|
@ -2497,7 +2497,8 @@ AC_SUBST(DEFINE_UINTPTR_T)
|
||||||
# These used by GSFileHandle.m and distributed objects
|
# These used by GSFileHandle.m and distributed objects
|
||||||
# On some systems we need -lnsl ... so check for that case.
|
# On some systems we need -lnsl ... so check for that case.
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
AC_SEARCH_LIBS([inet_ntop],[nsl])
|
AC_CHECK_HEADERS(ws2tcpip.h)
|
||||||
|
AC_SEARCH_LIBS([inet_ntop],[nsl Ws2_32])
|
||||||
AC_CHECK_FUNCS(gethostbyaddr_r inet_aton inet_pton inet_ntop sigaction)
|
AC_CHECK_FUNCS(gethostbyaddr_r inet_aton inet_pton inet_ntop sigaction)
|
||||||
|
|
||||||
USE_ZLIB=0
|
USE_ZLIB=0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue