Commit 9c8e3f13 authored by Mike Gabriel's avatar Mike Gabriel

nxcomp/configure.ac,m4/nx-macros.m4,nxcomp/src/Socket.h: Use AC_CHECK_TYPES to…

nxcomp/configure.ac,m4/nx-macros.m4,nxcomp/src/Socket.h: Use AC_CHECK_TYPES to detect if type 'in_addr_t' is available.
parent 9fa0a6b9
......@@ -303,12 +303,3 @@ rm -f conftest*])
FreeBSD=
test "$nxconf_cv_freebsd" = yes && FreeBSD=yes
]) # NX_BUILD_ON_FreeBSD
AC_DEFUN([NX_HAS_INADDRT],
[AC_CACHE_CHECK(for in_addr_t, nx_cv_inaddrt,
[AC_TRY_COMPILE([#include <netinet/in.h>],[in_addr_t t; t = 1; return t;],
nx_cv_inaddrt=yes, nx_cv_inaddrt=no)
rm -f conftest*])
INADDRT=
test "$nx_cv_inaddrt" = yes && INADDRT=yes
]) # NX_HAS_INADDRT
......@@ -63,16 +63,8 @@ if test "$FreeBSD" = yes; then
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
fi
NX_HAS_INADDRT
# If in_addr_t is not defined use unsigned int.
if test "$INADDRT" != yes ; then
echo -e "using unsigned int for type in_addr_t"
CPPFLAGS="$CPPFLAGS -DIN_ADDR_T=unsigned"
else
CPPFLAGS="$CPPFLAGS -DIN_ADDR_T=in_addr_t"
fi
AC_CHECK_TYPES([in_addr_t], [], [], [[#include <netinet/in.h>]])
AC_ARG_ENABLE(info,
[AS_HELP_STRING([--enable-debug], [enable to get info session log output (disabled by default)])],
......
......@@ -26,6 +26,10 @@
#ifndef Socket_H
#define Socket_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
......@@ -35,6 +39,12 @@
#include <sys/filio.h>
#endif
#ifdef HAVE_IN_ADDR_T
#define IN_ADDR_T in_addr_t
#else
#define IN_ADDR_T unsigned
#endif
//
// Set socket options.
//
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment