mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-10-22 02:37:26 +02:00
Apply BlueZeniX's patch for OpenSolaris compatibility. Fixes #158.
This commit is contained in:
@@ -13,6 +13,10 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#if (defined (__SVR4) && defined (__sun))
|
||||||
|
#include <alloca.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if _MSC_VER || __MINGW32__
|
#if _MSC_VER || __MINGW32__
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -10,6 +10,10 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#if (defined (__SVR4) && defined (__sun))
|
||||||
|
#include <alloca.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "root.h"
|
#include "root.h"
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
// in artistic.txt, or the GNU General Public License in gnu.txt.
|
// in artistic.txt, or the GNU General Public License in gnu.txt.
|
||||||
// See the included readme.txt for details.
|
// See the included readme.txt for details.
|
||||||
|
|
||||||
|
#define __C99FEATURES__ 1
|
||||||
|
|
||||||
/* Lexical Analyzer */
|
/* Lexical Analyzer */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
+10
-1
@@ -338,8 +338,10 @@ int main(int argc, char *argv[])
|
|||||||
global.params.os = OSMacOSX;
|
global.params.os = OSMacOSX;
|
||||||
#elif __FreeBSD__
|
#elif __FreeBSD__
|
||||||
global.params.os = OSFreeBSD;
|
global.params.os = OSFreeBSD;
|
||||||
|
#elif defined (__SVR4) && defined (__sun)
|
||||||
|
global.params.os = OSSolaris;
|
||||||
#else
|
#else
|
||||||
#error Unsupported OS
|
#error Unsupported OS
|
||||||
#endif /* linux */
|
#endif /* linux */
|
||||||
|
|
||||||
assert(global.params.os != OSinvalid);
|
assert(global.params.os != OSinvalid);
|
||||||
@@ -694,6 +696,8 @@ int main(int argc, char *argv[])
|
|||||||
global.params.os = OSMacOSX;
|
global.params.os = OSMacOSX;
|
||||||
else if(strcmp(p + 2, "FreeBSD") == 0)
|
else if(strcmp(p + 2, "FreeBSD") == 0)
|
||||||
global.params.os = OSFreeBSD;
|
global.params.os = OSFreeBSD;
|
||||||
|
else if(strcmp(p + 2, "Solaris") == 0)
|
||||||
|
global.params.os = OSSolaris;
|
||||||
else
|
else
|
||||||
error("unrecognized target os '%s'", p + 2);
|
error("unrecognized target os '%s'", p + 2);
|
||||||
}
|
}
|
||||||
@@ -929,6 +933,11 @@ int main(int argc, char *argv[])
|
|||||||
VersionCondition::addPredefinedGlobalIdent("Posix");
|
VersionCondition::addPredefinedGlobalIdent("Posix");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case OSSolaris:
|
||||||
|
VersionCondition::addPredefinedGlobalIdent("solaris");
|
||||||
|
VersionCondition::addPredefinedGlobalIdent("Posix");
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
assert(false && "Target OS not supported");
|
assert(false && "Target OS not supported");
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -61,7 +61,8 @@ enum OS
|
|||||||
OSLinux,
|
OSLinux,
|
||||||
OSWindows,
|
OSWindows,
|
||||||
OSMacOSX,
|
OSMacOSX,
|
||||||
OSFreeBSD
|
OSFreeBSD,
|
||||||
|
OSSolaris,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Put command line switches in here
|
// Put command line switches in here
|
||||||
|
|||||||
@@ -12,6 +12,10 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#if (defined (__SVR4) && defined (__sun))
|
||||||
|
#include <alloca.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if _MSC_VER || __MINGW32__
|
#if _MSC_VER || __MINGW32__
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -8,7 +8,13 @@
|
|||||||
// in artistic.txt, or the GNU General Public License in gnu.txt.
|
// in artistic.txt, or the GNU General Public License in gnu.txt.
|
||||||
// See the included readme.txt for details.
|
// 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
|
#define __USE_ISOC99 1 // so signbit() gets defined
|
||||||
|
|
||||||
|
#if (defined (__SVR4) && defined (__sun))
|
||||||
|
#include <alloca.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
@@ -14,6 +14,10 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#if (defined (__SVR4) && defined (__sun))
|
||||||
|
#include <alloca.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if _MSC_VER ||__MINGW32__
|
#if _MSC_VER ||__MINGW32__
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ void _STD_critical_term()
|
|||||||
|
|
||||||
/* ================================= linux ============================ */
|
/* ================================= linux ============================ */
|
||||||
|
|
||||||
#if linux || __APPLE__ || __FreeBSD__
|
#if linux || __APPLE__ || __FreeBSD__ || (defined(__SVR4) && defined (__sun))
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|||||||
@@ -14,9 +14,11 @@ import ldc.cstdarg;
|
|||||||
version(X86) {
|
version(X86) {
|
||||||
version(linux) version=X86_UNWIND;
|
version(linux) version=X86_UNWIND;
|
||||||
version(darwin) version=X86_UNWIND;
|
version(darwin) version=X86_UNWIND;
|
||||||
|
version(solaris) version=X86_UNWIND;
|
||||||
}
|
}
|
||||||
version(X86_64) {
|
version(X86_64) {
|
||||||
version(linux) version=X86_UNWIND;
|
version(linux) version=X86_UNWIND;
|
||||||
|
version(solaris) version=X86_UNWIND;
|
||||||
}
|
}
|
||||||
|
|
||||||
private extern(C) void abort();
|
private extern(C) void abort();
|
||||||
|
|||||||
@@ -73,6 +73,13 @@ private
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
version( solaris ) {
|
||||||
|
version(X86_64) {
|
||||||
|
extern (C) void* _userlimit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
extern (C) void* rt_stackBottom()
|
extern (C) void* rt_stackBottom()
|
||||||
{
|
{
|
||||||
version( Win32 )
|
version( Win32 )
|
||||||
@@ -110,6 +117,16 @@ extern (C) void* rt_stackBottom()
|
|||||||
// darwin has a fixed stack bottom
|
// darwin has a fixed stack bottom
|
||||||
return cast(void*) 0xc0000000;
|
return cast(void*) 0xc0000000;
|
||||||
}
|
}
|
||||||
|
else version( solaris )
|
||||||
|
{
|
||||||
|
version(X86_64) {
|
||||||
|
return _userlimit;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// <sys/vmparam.h>
|
||||||
|
return cast(void*) 0x8048000;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
static assert( false, "Operating system not supported." );
|
static assert( false, "Operating system not supported." );
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
#elif linux || __APPLE__
|
#elif linux || __APPLE__ || (defined (__SVR4) && defined (__sun))
|
||||||
#define USE_PTHREADS 1
|
#define USE_PTHREADS 1
|
||||||
#else
|
#else
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user