[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [COMMIT d741429] Add #defines needed by OpenSolaris, fix

From: Anthony Liguori
Subject: [Qemu-commits] [COMMIT d741429] Add #defines needed by OpenSolaris, fix breakage by the #defines
Date: Sat, 12 Sep 2009 13:08:48 -0000

From: Blue Swirl <address@hidden>

We need to define _XOPEN_SOURCE and __EXTENSIONS__ macros in order to get
CMSG_ and TIOCWIN macros defined. But then _POSIX_C_SOURCE gets defined, which
is (incorrectly) used as an indicator for existence of posix_memalign() in 

Signed-off-by: Blue Swirl <address@hidden>

diff --git a/configure b/configure
index 646da75..1160cf6 100755
--- a/configure
+++ b/configure
@@ -326,6 +326,10 @@ SunOS)
   audio_possible_drivers="oss sdl"
+# needed for CMSG_ macros in sys/socket.h
+# needed for TIOCWIN* defines in termios.h
   QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS"
   LIBS="-lsocket -lnsl -lresolv $LIBS"
diff --git a/osdep.c b/osdep.c
index 90cc95f..fd8bbd7 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);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]