mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 21:32:26 +00:00
-Ob not working on my FreeBSD, use -O1. Better LP64 detection for OpenBSD.
This commit is contained in:
parent
83aaa70290
commit
24aa3c6508
2 changed files with 17 additions and 12 deletions
|
|
@ -2,11 +2,17 @@
|
|||
#define SYSTEM__h
|
||||
|
||||
|
||||
// 64 bit system detection
|
||||
|
||||
#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64)
|
||||
#define __o_64
|
||||
#endif
|
||||
|
||||
// Temporary while bootstrapping and clearing up SYSTEM.c.
|
||||
|
||||
|
||||
#ifndef LONGINT
|
||||
#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64)
|
||||
#if defined (__o_64)
|
||||
#define INTEGER int32
|
||||
#define LONGINT int64
|
||||
#define SET uint64
|
||||
|
|
@ -24,7 +30,7 @@
|
|||
// Declare memcpy in a way compatible with C compilers intrinsic
|
||||
// built in implementations.
|
||||
|
||||
#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__)
|
||||
#if defined (__o_64)
|
||||
#if defined(_WIN64)
|
||||
typedef unsigned long long size_t;
|
||||
typedef long long address;
|
||||
|
|
@ -45,14 +51,14 @@ void *memcpy(void *dest, const void *source, size_t size);
|
|||
|
||||
// Declare fixed size versions of basic intger types
|
||||
|
||||
#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64)
|
||||
// ILP32 or LLP64
|
||||
typedef long long int64;
|
||||
typedef unsigned long long uint64;
|
||||
#else
|
||||
#if defined (__o_64) && !defined(_WIN64)
|
||||
// LP64
|
||||
typedef long int64;
|
||||
typedef unsigned long uint64;
|
||||
#else
|
||||
// ILP32 or LLP64
|
||||
typedef long long int64;
|
||||
typedef unsigned long long uint64;
|
||||
#endif
|
||||
|
||||
typedef int int32;
|
||||
|
|
@ -205,7 +211,6 @@ static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);}
|
|||
#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n)
|
||||
|
||||
|
||||
|
||||
extern int64 SYSTEM_DIV(int64 x, int64 y);
|
||||
#define __DIVF(x, y) SYSTEM_DIV(x, y)
|
||||
#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y))
|
||||
|
|
|
|||
|
|
@ -131,9 +131,9 @@ void determineCCompiler() {
|
|||
#if defined(__MINGW32__)
|
||||
compiler = "mingw";
|
||||
if (sizeof (void*) == 4) {
|
||||
cc = "i686-w64-mingw32-gcc -g -Og";
|
||||
cc = "i686-w64-mingw32-gcc -g -O1";
|
||||
} else {
|
||||
cc = "x86_64-w64-mingw32-gcc -g -Og";
|
||||
cc = "x86_64-w64-mingw32-gcc -g -O1";
|
||||
}
|
||||
#elif defined(__clang__)
|
||||
compiler = "clang";
|
||||
|
|
@ -142,9 +142,9 @@ void determineCCompiler() {
|
|||
compiler = "gcc";
|
||||
if (strncasecmp(os, "cygwin", 6) == 0) {
|
||||
// Avoid cygwin specific warning that -fPIC is ignored.
|
||||
cc = "gcc -g -Og";
|
||||
cc = "gcc -g -O1";
|
||||
} else {
|
||||
cc = "gcc -fPIC -g -Og";
|
||||
cc = "gcc -fPIC -g -O1";
|
||||
}
|
||||
#elif defined(_MSC_VER)
|
||||
compiler = "MSC";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue