-Ob not working on my FreeBSD, use -O1. Better LP64 detection for OpenBSD.

This commit is contained in:
David Brown 2016-09-10 12:24:06 +01:00
parent 83aaa70290
commit 24aa3c6508
2 changed files with 17 additions and 12 deletions

View file

@ -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))