Preliminary OpenBSD host support (based on OpenBSD patches by Todd T. Fries)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5012 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
blueswir1 2008-08-15 18:33:42 +00:00
parent 72c7b06cb7
commit 128ab2ff50
8 changed files with 75 additions and 4 deletions

View file

@ -15,7 +15,9 @@
* Solaris 10 with GCC4 does not need these macros as they
* are defined in <iso/math_c99.h> with a compiler directive
*/
#if defined(HOST_SOLARIS) && (( HOST_SOLARIS <= 9 ) || ((HOST_SOLARIS >= 10) && (__GNUC__ <= 4)))
#if defined(HOST_SOLARIS) && (( HOST_SOLARIS <= 9 ) || ((HOST_SOLARIS >= 10) \
&& (__GNUC__ <= 4))) \
|| defined(__OpenBSD__)
/*
* C99 7.12.3 classification macros
* and
@ -24,6 +26,9 @@
* ... do not work on Solaris 10 using GNU CC 3.4.x.
* Try to workaround the missing / broken C99 math macros.
*/
#if defined(__OpenBSD__)
#define unordered(x, y) (isnan(x) || isnan(y))
#endif
#define isnormal(x) (fpclass(x) >= FP_NZERO)
#define isgreater(x, y) ((!unordered(x, y)) && ((x) > (y)))
@ -84,6 +89,11 @@ typedef union {
| Software IEC/IEEE floating-point rounding mode.
*----------------------------------------------------------------------------*/
#if (defined(_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS)
#if defined(__OpenBSD__)
#define FE_RM FP_RM
#define FE_RP FP_RP
#define FE_RZ FP_RZ
#endif
enum {
float_round_nearest_even = FP_RN,
float_round_down = FP_RM,