aboutsummaryrefslogtreecommitdiff
path: root/nxcomp
diff options
context:
space:
mode:
Diffstat (limited to 'nxcomp')
-rw-r--r--nxcomp/configure.ac10
-rw-r--r--nxcomp/src/Socket.h10
2 files changed, 11 insertions, 9 deletions
diff --git a/nxcomp/configure.ac b/nxcomp/configure.ac
index 9d44a6991..42407c6fd 100644
--- a/nxcomp/configure.ac
+++ b/nxcomp/configure.ac
@@ -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)])],
diff --git a/nxcomp/src/Socket.h b/nxcomp/src/Socket.h
index 5e7e47705..77837a115 100644
--- a/nxcomp/src/Socket.h
+++ b/nxcomp/src/Socket.h
@@ -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.
//