Index: qemu-sockets.c =================================================================== --- qemu-sockets.c (revision 5728) +++ qemu-sockets.c (working copy) @@ -20,6 +20,7 @@ #include #include "qemu_socket.h" +#include "qemu-common.h" /* for qemu_isdigit */ #ifndef AI_ADDRCONFIG # define AI_ADDRCONFIG 0 @@ -120,7 +121,7 @@ return -1; } ai.ai_family = PF_INET6; - } else if (isdigit(str[0])) { + } else if (qemu_isdigit(str[0])) { /* IPv4 addr */ if (2 != sscanf(str,"%64[0-9.]:%32[^,]%n",addr,port,&pos)) { fprintf(stderr, "%s: ipv4 parse error (%s)\n", @@ -244,7 +245,7 @@ return -1; } ai.ai_family = PF_INET6; - } else if (isdigit(str[0])) { + } else if (qemu_isdigit(str[0])) { /* IPv4 addr */ if (2 != sscanf(str,"%64[0-9.]:%32[^,]",addr,port)) { fprintf(stderr, "%s: ipv4 parse error (%s)\n", Index: bswap.h =================================================================== --- bswap.h (revision 5728) +++ bswap.h (working copy) @@ -5,6 +5,12 @@ #include +#ifdef HAVE_MACHINE_BSWAP_H +#include +#include +#include +#else + #ifdef HAVE_BYTESWAP_H #include #else @@ -58,6 +64,8 @@ return bswap_64(x); } +#endif /* ! HAVE_MACHINE_BSWAP_H */ + static inline void bswap16s(uint16_t *s) { *s = bswap16(*s); Index: configure =================================================================== --- configure (revision 5728) +++ configure (working copy) @@ -147,6 +147,7 @@ bsd="yes" audio_drv_list="oss" audio_possible_drivers="oss sdl esd pa" +aiolib="-lpthread" if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then kqemu="yes" fi @@ -155,6 +156,8 @@ bsd="yes" audio_drv_list="oss" audio_possible_drivers="oss sdl esd" +oss_lib="-lossaudio" +aio_lib="-lrt -lpthread" ;; OpenBSD) bsd="yes" @@ -162,6 +165,7 @@ audio_drv_list="oss" audio_possible_drivers="oss sdl esd" oss_lib="-lossaudio" +aio_lib="-lpthread" ;; Darwin) bsd="yes" @@ -172,6 +176,7 @@ audio_possible_drivers="coreaudio sdl fmod" OS_CFLAGS="-mdynamic-no-pic" OS_LDFLAGS="-framework CoreFoundation -framework IOKit" +aio_lib="-lpthread" ;; SunOS) solaris="yes" @@ -517,7 +522,7 @@ if [ "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then AIOLIBS= elif [ "$bsd" = "yes" ]; then - AIOLIBS="-lpthread" + AIOLIBS="$aio_lib" else # Some Linux architectures (e.g. s390) don't imply -lpthread automatically. AIOLIBS="-lrt -lpthread" @@ -1210,6 +1225,15 @@ if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then echo "#define HAVE_BYTESWAP_H 1" >> $config_h fi + cat > $TMPC << EOF +#include +#include +#include +int main(void) { return bswap32(0); } +EOF + if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then + echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h + fi fi if [ "$openbsd" = "yes" ] ; then Index: fpu/softfloat-native.h =================================================================== --- fpu/softfloat-native.h (revision 5728) +++ fpu/softfloat-native.h (working copy) @@ -8,8 +8,7 @@ #include #endif -#ifdef __OpenBSD__ -/* Get OpenBSD version number */ +#if defined(__OpenBSD__) || defined(__NetBSD__) #include #endif @@ -35,6 +34,25 @@ #define unordered(x, y) (isnan(x) || isnan(y)) #endif +#ifdef __NetBSD__ +#ifndef isgreater +#define isgreater(x, y) __builtin_isgreater(x, y) +#endif +#ifndef isgreaterequal +#define isgreaterequal(x, y) __builtin_isgreaterequal(x, y) +#endif +#ifndef isless +#define isless(x, y) __builtin_isless(x, y) +#endif +#ifndef islessequal +#define islessequal(x, y) __builtin_islessequal(x, y) +#endif +#ifndef isunordered +#define isunordered(x, y) __builtin_isunordered(x, y) +#endif +#endif + + #define isnormal(x) (fpclass(x) >= FP_NZERO) #define isgreater(x, y) ((!unordered(x, y)) && ((x) > (y))) #define isgreaterequal(x, y) ((!unordered(x, y)) && ((x) >= (y)))