Add #defines needed by OpenSolaris, fix breakage by the #defines
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 osdep.c. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
31ff504d2a
commit
d741429a9b
4
configure
vendored
4
configure
vendored
@ -326,6 +326,10 @@ SunOS)
|
|||||||
audio_drv_list="oss"
|
audio_drv_list="oss"
|
||||||
fi
|
fi
|
||||||
audio_possible_drivers="oss sdl"
|
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"
|
QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS"
|
||||||
LIBS="-lsocket -lnsl -lresolv $LIBS"
|
LIBS="-lsocket -lnsl -lresolv $LIBS"
|
||||||
;;
|
;;
|
||||||
|
4
osdep.c
4
osdep.c
@ -48,7 +48,7 @@
|
|||||||
#include "sysemu.h"
|
#include "sysemu.h"
|
||||||
#include "qemu_socket.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)
|
static void *oom_check(void *ptr)
|
||||||
{
|
{
|
||||||
if (ptr == NULL) {
|
if (ptr == NULL) {
|
||||||
@ -87,7 +87,7 @@ void qemu_vfree(void *ptr)
|
|||||||
|
|
||||||
void *qemu_memalign(size_t alignment, size_t size)
|
void *qemu_memalign(size_t alignment, size_t size)
|
||||||
{
|
{
|
||||||
#if defined(_POSIX_C_SOURCE)
|
#if defined(_POSIX_C_SOURCE) && !defined(__sun__)
|
||||||
int ret;
|
int ret;
|
||||||
void *ptr;
|
void *ptr;
|
||||||
ret = posix_memalign(&ptr, alignment, size);
|
ret = posix_memalign(&ptr, alignment, size);
|
||||||
|
Loading…
Reference in New Issue
Block a user