mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-11-28 20:03:53 +01:00
Haiku OS support; thanks to MrSunshine
This commit is contained in:
+9
-3
@@ -315,7 +315,7 @@ char *Port::strupr(char *s)
|
||||
|
||||
#endif
|
||||
|
||||
#if linux || __APPLE__ || __FreeBSD__ || __MINGW32__
|
||||
#if linux || __APPLE__ || __FreeBSD__ || __MINGW32__ || __HAIKU__
|
||||
|
||||
#include <math.h>
|
||||
#if linux
|
||||
@@ -368,7 +368,7 @@ PortInitializer::PortInitializer()
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef __MINGW32__
|
||||
#if !defined __MINGW32__ && !defined __HAIKU__
|
||||
#undef isnan
|
||||
#endif
|
||||
int Port::isNan(double r)
|
||||
@@ -377,6 +377,8 @@ int Port::isNan(double r)
|
||||
return __inline_isnan(r);
|
||||
#elif defined __MINGW32__
|
||||
return isnan(r);
|
||||
#elif defined __HAIKU__
|
||||
return isnan(r);
|
||||
#else
|
||||
return ::isnan(r);
|
||||
#endif
|
||||
@@ -388,6 +390,8 @@ int Port::isNan(long double r)
|
||||
return __inline_isnan(r);
|
||||
#elif defined __MINGW32__
|
||||
return isnan(r);
|
||||
#elif defined __HAIKU__
|
||||
return isnan(r);
|
||||
#else
|
||||
return ::isnan(r);
|
||||
#endif
|
||||
@@ -415,7 +419,7 @@ int Port::isFinite(double r)
|
||||
return ::finite(r);
|
||||
}
|
||||
|
||||
#ifndef __MINGW32__
|
||||
#if !defined __MINGW32__ && !defined __HAIKU__
|
||||
#undef isinf
|
||||
#endif
|
||||
int Port::isInfinity(double r)
|
||||
@@ -424,6 +428,8 @@ int Port::isInfinity(double r)
|
||||
return fpclassify(r) == FP_INFINITE;
|
||||
#elif defined __MINGW32__
|
||||
return isinf(r);
|
||||
#elif defined __HAIKU__
|
||||
return isinf(r);
|
||||
#else
|
||||
return ::isinf(r);
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ struct Port
|
||||
static double dbl_min;
|
||||
static long double ldbl_max;
|
||||
|
||||
#if __GNUC__
|
||||
#if __GNUC__ && !defined __HAIKU__
|
||||
// These conflict with macros in math.h, should rename them
|
||||
#undef isnan
|
||||
#undef isfinite
|
||||
|
||||
@@ -34,6 +34,10 @@
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#ifdef __HAIKU__
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
#if POSIX
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
Reference in New Issue
Block a user