Apply BlueZeniX's patch for OpenSolaris compatibility. Fixes #158.

This commit is contained in:
Christian Kamm
2009-01-04 15:49:28 +01:00
parent 955df981f8
commit e7f750aee1
12 changed files with 57 additions and 4 deletions

View File

@@ -13,6 +13,10 @@
#include <string.h>
#include <assert.h>
#if (defined (__SVR4) && defined (__sun))
#include <alloca.h>
#endif
#if _MSC_VER || __MINGW32__
#include <malloc.h>
#endif

View File

@@ -10,6 +10,10 @@
#include <stdlib.h>
#include <ctype.h>
#if (defined (__SVR4) && defined (__sun))
#include <alloca.h>
#endif
#include "root.h"
#include "mem.h"

View File

@@ -8,6 +8,8 @@
// in artistic.txt, or the GNU General Public License in gnu.txt.
// See the included readme.txt for details.
#define __C99FEATURES__ 1
/* Lexical Analyzer */
#include <stdio.h>

View File

@@ -338,8 +338,10 @@ int main(int argc, char *argv[])
global.params.os = OSMacOSX;
#elif __FreeBSD__
global.params.os = OSFreeBSD;
#elif defined (__SVR4) && defined (__sun)
global.params.os = OSSolaris;
#else
#error Unsupported OS
#error Unsupported OS
#endif /* linux */
assert(global.params.os != OSinvalid);
@@ -694,6 +696,8 @@ int main(int argc, char *argv[])
global.params.os = OSMacOSX;
else if(strcmp(p + 2, "FreeBSD") == 0)
global.params.os = OSFreeBSD;
else if(strcmp(p + 2, "Solaris") == 0)
global.params.os = OSSolaris;
else
error("unrecognized target os '%s'", p + 2);
}
@@ -929,6 +933,11 @@ int main(int argc, char *argv[])
VersionCondition::addPredefinedGlobalIdent("Posix");
break;
case OSSolaris:
VersionCondition::addPredefinedGlobalIdent("solaris");
VersionCondition::addPredefinedGlobalIdent("Posix");
break;
default:
assert(false && "Target OS not supported");
}

View File

@@ -61,7 +61,8 @@ enum OS
OSLinux,
OSWindows,
OSMacOSX,
OSFreeBSD
OSFreeBSD,
OSSolaris,
};
// Put command line switches in here

View File

@@ -12,6 +12,10 @@
#include <stdlib.h>
#include <assert.h>
#if (defined (__SVR4) && defined (__sun))
#include <alloca.h>
#endif
#if _MSC_VER || __MINGW32__
#include <malloc.h>
#endif

View File

@@ -8,7 +8,13 @@
// in artistic.txt, or the GNU General Public License in gnu.txt.
// See the included readme.txt for details.
#define __C99FEATURES__ 1 // Needed on Solaris for NaN and more
#define __USE_ISOC99 1 // so signbit() gets defined
#if (defined (__SVR4) && defined (__sun))
#include <alloca.h>
#endif
#include <math.h>
#include <stdio.h>

View File

@@ -14,6 +14,10 @@
#include <stdint.h>
#include <assert.h>
#if (defined (__SVR4) && defined (__sun))
#include <alloca.h>
#endif
#if _MSC_VER ||__MINGW32__
#include <malloc.h>
#include <string>