aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure4
-rw-r--r--osdep.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/configure b/configure
index 646da7538..1160cf655 100755
--- a/configure
+++ b/configure
@@ -326,6 +326,10 @@ SunOS)
audio_drv_list="oss"
fi
audio_possible_drivers="oss sdl"
+# needed for CMSG_ macros in sys/socket.h
+ QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS"
+# needed for TIOCWIN* defines in termios.h
+ QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS"
QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS"
LIBS="-lsocket -lnsl -lresolv $LIBS"
;;
diff --git a/osdep.c b/osdep.c
index 90cc95fd7..fd8bbd7e2 100644
--- a/osdep.c
+++ b/osdep.c
@@ -48,7 +48,7 @@
#include "sysemu.h"
#include "qemu_socket.h"
-#if !defined(_POSIX_C_SOURCE) || defined(_WIN32)
+#if !defined(_POSIX_C_SOURCE) || defined(_WIN32) || defined(__sun__)
static void *oom_check(void *ptr)
{
if (ptr == NULL) {
@@ -87,7 +87,7 @@ void qemu_vfree(void *ptr)
void *qemu_memalign(size_t alignment, size_t size)
{
-#if defined(_POSIX_C_SOURCE)
+#if defined(_POSIX_C_SOURCE) && !defined(__sun__)
int ret;
void *ptr;
ret = posix_memalign(&ptr, alignment, size);