#ifndef _PORTABLEXDR_BYTESWAP_H
#define _PORTABLEXDR_BYTESWAP_H 1
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
/* Swap bytes in 16 bit value. */
#define __bswap_constant_16(x) \
((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))
htonl (x)
uint32_t x;
{
+#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && defined(LITTLE_ENDIAN)
#if BYTE_ORDER == BIG_ENDIAN
return x;
#elif BYTE_ORDER == LITTLE_ENDIAN
#else
# error "What kind of system is this?"
#endif
+#else
+#error "BYTE_ORDER/BIG_ENDIAN/LITTLE_ENDIAN are not defined"
+#endif
}
#define ntohl htonl
htons (x)
uint16_t x;
{
+#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && defined(LITTLE_ENDIAN)
#if BYTE_ORDER == BIG_ENDIAN
return x;
#elif BYTE_ORDER == LITTLE_ENDIAN
#else
# error "What kind of system is this?"
#endif
+#else
+#error "BYTE_ORDER/BIG_ENDIAN/LITTLE_ENDIAN are not defined"
+#endif
}
#define ntohs htons
-AC_INIT(portablexdr, 4.0.10)
+AC_INIT(portablexdr, 4.0.11)
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h])
esac
AC_SUBST(MINGW_EXTRA_LDFLAGS)
-AC_CHECK_HEADERS([arpa/inet.h])
+AC_CHECK_HEADERS([arpa/inet.h sys/param.h])
AC_CHECK_FUNCS([ntohl htonl ntohs htons])
AC_OUTPUT(Makefile)