提交 179a2c19 编写于 作者: B blueswir1

Rename _BSD to HOST_BSD so that it's more obvious that it's defined by configure

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6775 c046a42c-6fe2-441c-8c8c-71466251a162
上级 d5575a38
...@@ -750,7 +750,7 @@ static int64_t raw_getlength(BlockDriverState *bs) ...@@ -750,7 +750,7 @@ static int64_t raw_getlength(BlockDriverState *bs)
BDRVRawState *s = bs->opaque; BDRVRawState *s = bs->opaque;
int fd = s->fd; int fd = s->fd;
int64_t size; int64_t size;
#ifdef _BSD #ifdef HOST_BSD
struct stat sb; struct stat sb;
#endif #endif
#ifdef __sun__ #ifdef __sun__
...@@ -763,7 +763,7 @@ static int64_t raw_getlength(BlockDriverState *bs) ...@@ -763,7 +763,7 @@ static int64_t raw_getlength(BlockDriverState *bs)
if (ret < 0) if (ret < 0)
return ret; return ret;
#ifdef _BSD #ifdef HOST_BSD
if (!fstat(fd, &sb) && (S_IFCHR & sb.st_mode)) { if (!fstat(fd, &sb) && (S_IFCHR & sb.st_mode)) {
#ifdef DIOCGMEDIASIZE #ifdef DIOCGMEDIASIZE
if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&size)) if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&size))
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include "config-host.h" #include "config-host.h"
#ifdef _BSD #ifdef HOST_BSD
/* include native header before sys-queue.h */ /* include native header before sys-queue.h */
#include <sys/queue.h> #include <sys/queue.h>
#endif #endif
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "monitor.h" #include "monitor.h"
#include "block_int.h" #include "block_int.h"
#ifdef _BSD #ifdef HOST_BSD
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
......
...@@ -1520,7 +1520,7 @@ fi ...@@ -1520,7 +1520,7 @@ fi
if [ "$bsd" = "yes" ] ; then if [ "$bsd" = "yes" ] ; then
echo "#define O_LARGEFILE 0" >> $config_h echo "#define O_LARGEFILE 0" >> $config_h
echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
echo "#define _BSD 1" >> $config_h echo "#define HOST_BSD 1" >> $config_h
fi fi
echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
......
...@@ -82,7 +82,7 @@ typedef void * host_reg_t; ...@@ -82,7 +82,7 @@ typedef void * host_reg_t;
#define UINT32_MAX (4294967295U) #define UINT32_MAX (4294967295U)
#define UINT64_MAX ((uint64_t)(18446744073709551615)) #define UINT64_MAX ((uint64_t)(18446744073709551615))
#ifdef _BSD #ifdef HOST_BSD
typedef struct __sFILE FILE; typedef struct __sFILE FILE;
#else #else
typedef struct FILE FILE; typedef struct FILE FILE;
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
void set_float_rounding_mode(int val STATUS_PARAM) void set_float_rounding_mode(int val STATUS_PARAM)
{ {
STATUS(float_rounding_mode) = val; STATUS(float_rounding_mode) = val;
#if defined(_BSD) && !defined(__APPLE__) || (defined(HOST_SOLARIS) && HOST_SOLARIS < 10) #if defined(HOST_BSD) && !defined(__APPLE__) || \
(defined(HOST_SOLARIS) && HOST_SOLARIS < 10)
fpsetround(val); fpsetround(val);
#elif defined(__arm__) #elif defined(__arm__)
/* nothing to do */ /* nothing to do */
...@@ -22,7 +23,7 @@ void set_floatx80_rounding_precision(int val STATUS_PARAM) ...@@ -22,7 +23,7 @@ void set_floatx80_rounding_precision(int val STATUS_PARAM)
} }
#endif #endif
#if defined(_BSD) || (defined(HOST_SOLARIS) && HOST_SOLARIS < 10) #if defined(HOST_BSD) || (defined(HOST_SOLARIS) && HOST_SOLARIS < 10)
#define lrint(d) ((int32_t)rint(d)) #define lrint(d) ((int32_t)rint(d))
#define llrint(d) ((int64_t)rint(d)) #define llrint(d) ((int64_t)rint(d))
#define lrintf(f) ((int32_t)rint(f)) #define lrintf(f) ((int32_t)rint(f))
......
/* Native implementation of soft float functions */ /* Native implementation of soft float functions */
#include <math.h> #include <math.h>
#if (defined(_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS) #if (defined(HOST_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS)
#include <ieeefp.h> #include <ieeefp.h>
#define fabsf(f) ((float)fabs(f)) #define fabsf(f) ((float)fabs(f))
#else #else
...@@ -111,7 +111,7 @@ typedef union { ...@@ -111,7 +111,7 @@ typedef union {
/*---------------------------------------------------------------------------- /*----------------------------------------------------------------------------
| Software IEC/IEEE floating-point rounding mode. | Software IEC/IEEE floating-point rounding mode.
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
#if (defined(_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS) #if (defined(HOST_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS)
#if defined(__OpenBSD__) #if defined(__OpenBSD__)
#define FE_RM FP_RM #define FE_RM FP_RM
#define FE_RP FP_RP #define FE_RP FP_RP
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <zlib.h> #include <zlib.h>
/* Needed early for _BSD etc. */ /* Needed early for HOST_BSD etc. */
#include "config-host.h" #include "config-host.h"
#ifndef _WIN32 #ifndef _WIN32
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#include <dirent.h> #include <dirent.h>
#include <netdb.h> #include <netdb.h>
#include <sys/select.h> #include <sys/select.h>
#ifdef _BSD #ifdef HOST_BSD
#include <sys/stat.h> #include <sys/stat.h>
#if defined(__FreeBSD__) || defined(__DragonFly__) #if defined(__FreeBSD__) || defined(__DragonFly__)
#include <libutil.h> #include <libutil.h>
...@@ -769,7 +769,7 @@ static TAPState *net_tap_fd_init(VLANState *vlan, ...@@ -769,7 +769,7 @@ static TAPState *net_tap_fd_init(VLANState *vlan,
return s; return s;
} }
#if defined (_BSD) || defined (__FreeBSD_kernel__) #if defined (HOST_BSD) || defined (__FreeBSD_kernel__)
static int tap_open(char *ifname, int ifname_size) static int tap_open(char *ifname, int ifname_size)
{ {
int fd; int fd;
......
...@@ -33,13 +33,13 @@ ...@@ -33,13 +33,13 @@
#include <sys/statvfs.h> #include <sys/statvfs.h>
#endif #endif
/* Needed early for _BSD etc. */ /* Needed early for HOST_BSD etc. */
#include "config-host.h" #include "config-host.h"
#ifdef _WIN32 #ifdef _WIN32
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#elif defined(_BSD) #elif defined(HOST_BSD)
#include <stdlib.h> #include <stdlib.h>
#else #else
#include <malloc.h> #include <malloc.h>
...@@ -188,7 +188,7 @@ void *qemu_memalign(size_t alignment, size_t size) ...@@ -188,7 +188,7 @@ void *qemu_memalign(size_t alignment, size_t size)
if (ret != 0) if (ret != 0)
return NULL; return NULL;
return ptr; return ptr;
#elif defined(_BSD) #elif defined(HOST_BSD)
return valloc(size); return valloc(size);
#else #else
return memalign(alignment, size); return memalign(alignment, size);
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
#include <dirent.h> #include <dirent.h>
#include <netdb.h> #include <netdb.h>
#include <sys/select.h> #include <sys/select.h>
#ifdef _BSD #ifdef HOST_BSD
#include <sys/stat.h> #include <sys/stat.h>
#ifdef __FreeBSD__ #ifdef __FreeBSD__
#include <libutil.h> #include <libutil.h>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <zlib.h> #include <zlib.h>
/* Needed early for _BSD etc. */ /* Needed early for HOST_BSD etc. */
#include "config-host.h" #include "config-host.h"
#ifndef _WIN32 #ifndef _WIN32
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#include <dirent.h> #include <dirent.h>
#include <netdb.h> #include <netdb.h>
#include <sys/select.h> #include <sys/select.h>
#ifdef _BSD #ifdef HOST_BSD
#include <sys/stat.h> #include <sys/stat.h>
#if defined(__FreeBSD__) || defined(__DragonFly__) #if defined(__FreeBSD__) || defined(__DragonFly__)
#include <libutil.h> #include <libutil.h>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <zlib.h> #include <zlib.h>
/* Needed early for _BSD etc. */ /* Needed early for HOST_BSD etc. */
#include "config-host.h" #include "config-host.h"
#ifndef _WIN32 #ifndef _WIN32
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
#include <dirent.h> #include <dirent.h>
#include <netdb.h> #include <netdb.h>
#include <sys/select.h> #include <sys/select.h>
#ifdef _BSD #ifdef HOST_BSD
#include <sys/stat.h> #include <sys/stat.h>
#if defined(__FreeBSD__) || defined(__DragonFly__) #if defined(__FreeBSD__) || defined(__DragonFly__)
#include <libutil.h> #include <libutil.h>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册