Add basic SYSTEM.ADRINT type.

This commit is contained in:
David Brown 2016-08-26 16:28:07 +01:00
parent da88496c5f
commit b6385f8b8c
214 changed files with 680 additions and 649 deletions

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
@ -13,6 +13,6 @@ export void *Configuration__init(void)
__DEFMOD;
__REGMOD("Configuration", 0);
/* BEGIN */
__MOVE("1.95 [2016/08/23] for gcc LP64 on cygwin", Configuration_versionLong, 41);
__MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41);
__ENDMOD;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Configuration__h
#define Configuration__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "Platform.h"
@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len);
void Console_Flush (void)
{
INTEGER error;
error = Platform_Write(Platform_StdOut, (LONGINT)(SYSTEM_ADDRESS)Console_line, Console_pos);
error = Platform_Write(Platform_StdOut, (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos);
Console_pos = 0;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Console__h
#define Console__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */
#include "SYSTEM.h"
#include "Configuration.h"
#include "Console.h"
@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf)
if (buf->org != f->pos) {
error = Platform_Seek(f->fd, buf->org, Platform_SeekSet);
}
error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADDRESS)buf->data, buf->size);
error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size);
if (error != 0) {
Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error);
}
@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x
} else {
min = n;
}
__MOVE((LONGINT)(SYSTEM_ADDRESS)buf->data + offset, (LONGINT)(SYSTEM_ADDRESS)x + xpos, min);
__MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min);
offset += min;
(*r).offset = offset;
xpos += min;
@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT
} else {
min = n;
}
__MOVE((LONGINT)(SYSTEM_ADDRESS)x + xpos, (LONGINT)(SYSTEM_ADDRESS)buf->data + offset, min);
__MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min);
offset += min;
(*r).offset = offset;
if (offset > buf->size) {
@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT
*res = 3;
return;
}
error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n);
error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n);
while (n > 0) {
error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADDRESS)buf, n);
error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n);
if (error != 0) {
ignore = Platform_Close(fdold);
ignore = Platform_Close(fdnew);
Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error);
}
error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n);
error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n);
}
ignore = Platform_Close(fdold);
ignore = Platform_Close(fdnew);
@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de
j += 1;
}
} else {
__MOVE((LONGINT)(SYSTEM_ADDRESS)src, (LONGINT)(SYSTEM_ADDRESS)dest, src__len);
__MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len);
}
}
@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o)
{
Files_File f = NIL;
LONGINT res;
f = (Files_File)(SYSTEM_ADDRESS)o;
f = (Files_File)(SYSTEM_ADRINT)o;
if (f->fd >= 0) {
Files_CloseOSFile(f);
if (f->tempFile) {

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */
#ifndef Files__h
#define Files__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */
#include "SYSTEM.h"
struct Heap__1 {
@ -101,7 +101,7 @@ export void Heap_Unlock (void);
extern void *Heap__init();
extern LONGINT Platform_MainStackFrame;
extern LONGINT Platform_OSAllocate(LONGINT size);
#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer)))
#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer)))
#define Heap_HeapModuleInit() Heap__init()
#define Heap_OSAllocate(size) Platform_OSAllocate(size)
#define Heap_PlatformHalt(code) Platform_Halt(code)
@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs)
__COPY(name, m->name, ((LONGINT)(20)));
m->refcnt = 0;
m->enumPtrs = enumPtrs;
m->next = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules;
m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules;
Heap_modules = (SYSTEM_PTR)m;
_o_result = (void*)m;
return _o_result;
@ -315,7 +315,7 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag)
__PUT(adr + 8, 0, LONGINT);
Heap_allocated += blksz;
Heap_Unlock();
_o_result = (SYSTEM_PTR)(SYSTEM_ADDRESS)(adr + 4);
_o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4);
return _o_result;
}
@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size)
SYSTEM_PTR new;
Heap_Lock();
blksz = __ASHL(__ASHR(size + 31, 4), 4);
new = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)&blksz);
tag = ((LONGINT)(SYSTEM_ADDRESS)new + blksz) - 12;
new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz);
tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12;
__PUT(tag - 4, 0, LONGINT);
__PUT(tag, blksz, LONGINT);
__PUT(tag + 4, -4, LONGINT);
__PUT((LONGINT)(SYSTEM_ADDRESS)new - 4, tag, LONGINT);
__PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT);
Heap_Unlock();
_o_result = new;
return _o_result;
@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q)
__GET(tag, offset, LONGINT);
fld = q + offset;
p = Heap_FetchAddress(fld);
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)n, SYSTEM_PTR);
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR);
} else {
fld = q + offset;
n = Heap_FetchAddress(fld);
@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q)
if (!__ODD(tagbits)) {
__PUT(n - 4, tagbits + 1, LONGINT);
__PUT(q - 4, tag + 1, LONGINT);
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)p, SYSTEM_PTR);
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR);
p = q;
q = n;
tag = tagbits;
@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q)
static void Heap_MarkP (SYSTEM_PTR p)
{
Heap_Mark((LONGINT)(SYSTEM_ADDRESS)p);
Heap_Mark((LONGINT)(SYSTEM_ADRINT)p);
}
static void Heap_Scan (void)
@ -553,7 +553,7 @@ static void Heap_Finalize (void)
} else {
prev->next = n->next;
}
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj);
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj);
if (prev == NIL) {
n = Heap_fin;
} else {
@ -572,7 +572,7 @@ void Heap_FINALL (void)
while (Heap_fin != NIL) {
n = Heap_fin;
Heap_fin = Heap_fin->next;
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj);
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj);
}
}
@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len)
}
if (n == 0) {
nofcand = 0;
sp = (LONGINT)(SYSTEM_ADDRESS)&frame;
sp = (LONGINT)(SYSTEM_ADRINT)&frame;
stack0 = Heap_PlatformMainStackFrame();
inc = (LONGINT)(SYSTEM_ADDRESS)&align.p - (LONGINT)(SYSTEM_ADDRESS)&align;
inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align;
if (sp > stack0) {
inc = -inc;
}
@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack)
LONGINT cand[10000];
if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) {
Heap_Lock();
m = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules;
m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules;
while (m != NIL) {
if (m->enumPtrs != NIL) {
(*m->enumPtrs)(Heap_MarkP);
@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize)
{
Heap_FinNode f;
__NEW(f, Heap_FinDesc);
f->obj = (LONGINT)(SYSTEM_ADDRESS)obj;
f->obj = (LONGINT)(SYSTEM_ADRINT)obj;
f->finalize = finalize;
f->marked = 1;
f->next = Heap_fin;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */
#ifndef Heap__h
#define Heap__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "Console.h"
#include "Heap.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Modules__h
#define Modules__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "OPM.h"
#include "OPS.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPB__h
#define OPB__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "Configuration.h"
#include "OPM.h"
@ -211,7 +211,7 @@ void OPC_Ident (OPT_Object obj)
OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32)));
}
OPM_Write('_');
} else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) {
} else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) {
OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8);
}
OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256)));

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPC__h
#define OPC__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "Configuration.h"
#include "Console.h"
@ -544,15 +544,15 @@ void OPM_FPrintReal (LONGINT *fp, REAL real)
{
INTEGER i;
LONGINT l;
__GET((LONGINT)(SYSTEM_ADDRESS)&real, l, LONGINT);
__GET((LONGINT)(SYSTEM_ADRINT)&real, l, LONGINT);
OPM_FPrint(&*fp, l);
}
void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr)
{
LONGINT l, h;
__GET((LONGINT)(SYSTEM_ADDRESS)&lr, l, LONGINT);
__GET((LONGINT)(SYSTEM_ADDRESS)&lr + 4, h, LONGINT);
__GET((LONGINT)(SYSTEM_ADRINT)&lr, l, LONGINT);
__GET((LONGINT)(SYSTEM_ADRINT)&lr + 4, h, LONGINT);
OPM_FPrint(&*fp, l);
OPM_FPrint(&*fp, h);
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPM__h
#define OPM__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "OPB.h"
#include "OPM.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPP__h
#define OPP__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */
#include "SYSTEM.h"
#include "OPM.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */
#ifndef OPS__h
#define OPS__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "OPM.h"
#include "OPS.h"
@ -83,7 +83,7 @@ typedef
export void (*OPT_typSize)(OPT_Struct);
export OPT_Object OPT_topScope;
export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp;
export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp;
export SHORTINT OPT_nofGmod;
export OPT_Object OPT_GlbMod[64];
export OPS_Name OPT_SelfName;
@ -1718,6 +1718,7 @@ static void EnumPtrs(void (*P)(void*))
P(OPT_sinttyp);
P(OPT_inttyp);
P(OPT_linttyp);
P(OPT_ainttyp);
P(OPT_realtyp);
P(OPT_lrltyp);
P(OPT_settyp);
@ -1794,6 +1795,7 @@ export void *OPT__init(void)
OPT_undftyp->BaseTyp = OPT_undftyp;
OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp);
OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp);
OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp);
OPT_EnterProc((CHAR*)"ADR", 20);
OPT_EnterProc((CHAR*)"CC", 21);
OPT_EnterProc((CHAR*)"LSH", 22);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPT__h
#define OPT__h
@ -67,7 +67,7 @@ typedef
import void (*OPT_typSize)(OPT_Struct);
import OPT_Object OPT_topScope;
import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp;
import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp;
import SHORTINT OPT_nofGmod;
import OPT_Object OPT_GlbMod[64];
import OPS_Name OPT_SelfName;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "OPC.h"
#include "OPM.h"
@ -284,6 +284,7 @@ void OPV_AdrAndSize (OPT_Object topScope)
OPT_realtyp->strobj->linkadr = 2;
OPT_inttyp->strobj->linkadr = 2;
OPT_linttyp->strobj->linkadr = 2;
OPT_ainttyp->strobj->linkadr = 2;
OPT_lrltyp->strobj->linkadr = 2;
OPT_sinttyp->strobj->linkadr = 2;
OPT_booltyp->strobj->linkadr = 2;
@ -931,7 +932,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec)
OPM_Write(')');
break;
case 24:
OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADDRESS)", (LONGINT)26);
OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25);
if (l->class == 1) {
OPC_CompleteIdent(l->obj);
} else {
@ -947,7 +948,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec)
OPC_Ident(n->typ->strobj);
OPM_Write(')');
if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) {
OPM_WriteString((CHAR*)"(SYSTEM_ADDRESS)", (LONGINT)17);
OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16);
}
OPV_expr(l, exprPrec);
} else {

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPV__h
#define OPV__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
typedef
@ -111,9 +111,9 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT
extern void Heap_InitHeap();
#define Platform_GetTickCount() (LONGINT)(SYSTEM_CARD32)GetTickCount()
#define Platform_HeapInitHeap() Heap_InitHeap()
#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADDRESS)h)
#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADDRESS)h)
#define Platform_allocate(size) (LONGINT)(SYSTEM_ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))
#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h)
#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h)
#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))
#define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh
#define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow
#define Platform_bhfiMtimeHigh() (LONGINT)bhfi.ftLastWriteTime.dwHighDateTime
@ -121,44 +121,44 @@ extern void Heap_InitHeap();
#define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber
#define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi
#define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread);
#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(SYSTEM_ADDRESS)h)
#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(SYSTEM_ADRINT)h)
#define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi)
#define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n)
#define Platform_err() (INTEGER)GetLastError()
#define Platform_errc(c) WriteFile((HANDLE)(SYSTEM_ADDRESS)Platform_StdOut, &c, 1, 0,0)
#define Platform_errstring(s, s__len) WriteFile((HANDLE)(SYSTEM_ADDRESS)Platform_StdOut, s, s__len-1, 0,0)
#define Platform_errc(c) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, &c, 1, 0,0)
#define Platform_errstring(s, s__len) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, s, s__len-1, 0,0)
#define Platform_exit(code) ExitProcess((UINT)code)
#define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st)
#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADDRESS)h)
#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADDRESS)address)
#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADRINT)h)
#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADRINT)address)
#define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime
#define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n)
#define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode);
#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADDRESS)h, &bhfi)
#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart
#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADDRESS)h, &li)
#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADRINT)h, &bhfi)
#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart
#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADRINT)h, &li)
#define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st)
#define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len)
#define Platform_getpid() (INTEGER)GetCurrentProcessId()
#define Platform_getstderrhandle() (SYSTEM_ADDRESS)GetStdHandle(STD_ERROR_HANDLE)
#define Platform_getstdinhandle() (SYSTEM_ADDRESS)GetStdHandle(STD_INPUT_HANDLE)
#define Platform_getstdouthandle() (SYSTEM_ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE)
#define Platform_getstderrhandle() (SYSTEM_ADRINT)GetStdHandle(STD_ERROR_HANDLE)
#define Platform_getstdinhandle() (SYSTEM_ADRINT)GetStdHandle(STD_INPUT_HANDLE)
#define Platform_getstdouthandle() (SYSTEM_ADRINT)GetStdHandle(STD_OUTPUT_HANDLE)
#define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow
#define Platform_invalidHandleValue() ((LONGINT)(SYSTEM_ADDRESS)INVALID_HANDLE_VALUE)
#define Platform_invalidHandleValue() ((LONGINT)(SYSTEM_ADRINT)INVALID_HANDLE_VALUE)
#define Platform_largeInteger() LARGE_INTEGER li
#define Platform_liLongint() (LONGINT)li.QuadPart
#define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING)
#define Platform_opennew(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)
#define Platform_openro(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
#define Platform_openrw(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
#define Platform_opennew(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)
#define Platform_openro(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
#define Platform_openrw(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
#define Platform_processInfo() PROCESS_INFORMATION pi = {0};
#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(SYSTEM_ADDRESS)fd, (void*)(SYSTEM_ADDRESS)(p), (DWORD)l, (DWORD*)n, 0)
#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, (DWORD*)n, 0)
#define Platform_seekcur() FILE_CURRENT
#define Platform_seekend() FILE_END
#define Platform_seekset() FILE_BEGIN
#define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n)
#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADDRESS)h)
#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADDRESS)h, li, 0, (DWORD)r)
#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADRINT)h)
#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, li, 0, (DWORD)r)
#define Platform_sleep(ms) Sleep((DWORD)ms)
#define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft)
#define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si);
@ -173,7 +173,7 @@ extern void Heap_InitHeap();
#define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL)
#define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL)
#define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE)
#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADDRESS)fd, (void*)(SYSTEM_ADDRESS)(p), (DWORD)l, 0,0)
#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, 0,0)
BOOLEAN Platform_TooManyFiles (INTEGER e)
{
@ -241,7 +241,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr)
Platform_ArgVecPtr av = NIL;
Platform_MainStackFrame = argvadr;
Platform_ArgCount = argc;
av = (Platform_ArgVecPtr)(SYSTEM_ADDRESS)argvadr;
av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr;
Platform_ArgVector = (*av)[0];
Platform_HaltCode = -128;
Platform_HeapInitHeap();
@ -280,7 +280,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len)
{
Platform_ArgVec av = NIL;
if (n < Platform_ArgCount) {
av = (Platform_ArgVec)(SYSTEM_ADDRESS)Platform_ArgVector;
av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector;
__COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len);
}
}
@ -559,7 +559,7 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n)
INTEGER _o_result;
INTEGER result;
*n = 0;
result = Platform_readfile(h, (LONGINT)(SYSTEM_ADDRESS)b, b__len, &*n);
result = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len, &*n);
if (result == 0) {
*n = 0;
_o_result = Platform_err();
@ -795,7 +795,7 @@ static void Platform_TestLittleEndian (void)
{
INTEGER i;
i = 1;
__GET((LONGINT)(SYSTEM_ADDRESS)&i, Platform_LittleEndian, BOOLEAN);
__GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN);
}
__TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 20), {-4}};

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Platform__h
#define Platform__h
@ -78,7 +78,7 @@ import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l);
import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len);
import void *Platform__init(void);
#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADDRESS)h)
#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADDRESS)h)
#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h)
#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h)
#endif

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x)
{
INTEGER _o_result;
INTEGER i;
__GET((LONGINT)(SYSTEM_ADDRESS)&x + 2, i, INTEGER);
__GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER);
_o_result = __MASK(__ASHR(i, 7), -256);
return _o_result;
}
@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x)
void Reals_SetExpo (REAL *x, INTEGER ex)
{
CHAR c;
__GET((LONGINT)(SYSTEM_ADDRESS)x + 3, c, CHAR);
__PUT((LONGINT)(SYSTEM_ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR);
__GET((LONGINT)(SYSTEM_ADDRESS)x + 2, c, CHAR);
__PUT((LONGINT)(SYSTEM_ADDRESS)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR);
__GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR);
__PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR);
__GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR);
__PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR);
}
INTEGER Reals_ExpoL (LONGREAL x)
{
INTEGER _o_result;
INTEGER i;
__GET((LONGINT)(SYSTEM_ADDRESS)&x + 6, i, INTEGER);
__GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER);
_o_result = __MASK(__ASHR(i, 4), -2048);
return _o_result;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Reals__h
#define Reals__h

View file

@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0)
void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)())
{
while (n > 0) {
P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr))));
P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr))));
adr = ((void**)adr) + 1;
n--;
}
@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim,
else if (typ == (LONGINT*)POINTER__typ) {
/* element type is a pointer */
x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT));
p = (LONGINT*)(SYSTEM_ADDRESS)x[-1];
p = (LONGINT*)(SYSTEM_ADRINT)x[-1];
p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */
p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */
while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;}
@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim,
while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */
nptr = nofelems * nofptrs; /* total number of pointers */
x = Heap_NEWBLK(size + nptr * sizeof(LONGINT));
p = (LONGINT*)(SYSTEM_ADDRESS)x[- 1];
p = (LONGINT*)(SYSTEM_ADRINT)x[- 1];
p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */
p -= nptr - 1; n = 0; off = dataoff;
while (n < nofelems) {i = 0;
@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler
// (Ignore other signals)
}
void SystemSetHandler(int s, SYSTEM_ADDRESS h) {
void SystemSetHandler(int s, SYSTEM_ADRINT h) {
if (s >= 2 && s <= 4) {
int needtosetsystemhandler = handler[s-2] == 0;
handler[s-2] = (SystemSignalHandler)h;
@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler
}
}
void SystemSetInterruptHandler(SYSTEM_ADDRESS h) {
void SystemSetInterruptHandler(SYSTEM_ADRINT h) {
EnsureConsoleCtrlHandler();
SystemInterruptHandler = (SystemSignalHandler)h;
}
void SystemSetQuitHandler(SYSTEM_ADDRESS h) {
void SystemSetQuitHandler(SYSTEM_ADRINT h) {
EnsureConsoleCtrlHandler();
SystemQuitHandler = (SystemSignalHandler)h;
}

View file

@ -26,11 +26,12 @@ typedef unsigned char SYSTEM_CARD8;
typedef unsigned int size_t;
#endif
#define SYSTEM_ADDRESS size_t
#define SYSTEM_ADRINT size_t
#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap
#define _SIZE_T_DECLARED // For FreeBSD
#define _SIZE_T_DEFINED_ // For OpenBSD
void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size);
void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size);
@ -107,10 +108,10 @@ extern LONGINT SYSTEM_ENTIER (double x);
// Signal handling in SYSTEM.c
#ifndef _WIN32
extern void SystemSetHandler(int s, SYSTEM_ADDRESS h);
extern void SystemSetHandler(int s, SYSTEM_ADRINT h);
#else
extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h);
extern void SystemSetQuitHandler (SYSTEM_ADDRESS h);
extern void SystemSetInterruptHandler(SYSTEM_ADRINT h);
extern void SystemSetQuitHandler (SYSTEM_ADRINT h);
#endif
@ -133,9 +134,9 @@ static int __str_cmp(CHAR *x, CHAR *y){
#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \
while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;}
#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t))
#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t))
#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t))
#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x)
#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x)
@ -145,8 +146,8 @@ static int __str_cmp(CHAR *x, CHAR *y){
#define __VAL(t, x) (*(t*)&(x))
#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a)
#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x
#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a)
#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x
#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n)))
#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n)))
@ -161,7 +162,7 @@ static int __str_cmp(CHAR *x, CHAR *y){
#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t))
#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1)
#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n)
#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n)
#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n))
#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0)))
#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y)))
@ -222,7 +223,7 @@ extern void Heap_INCREF();
extern void Platform_Init(INTEGER argc, LONGINT argv);
extern void Heap_FINALL();
#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv);
#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv);
#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum)
#define __FINI Heap_FINALL(); return 0
@ -243,7 +244,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag);
extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...);
#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len))
#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ)
#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ)
#define __NEWARR SYSTEM_NEWARR
@ -274,20 +275,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...);
#define __INITYP(t, t0, level) \
t##__typ = (LONGINT*)&t##__desc.blksz; \
memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \
t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \
t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \
t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \
t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \
if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \
t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \
Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \
Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \
SYSTEM_INHERIT(t##__typ, t0##__typ)
#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ)
#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1)))
#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ)
#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1)))
#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level)
// Oberon-2 type bound procedures support
#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc
#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist
#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc
#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Strings__h
#define Strings__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "Files.h"
#include "Modules.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Texts__h
#define Texts__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkamSf */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */
#include "SYSTEM.h"
#include "Configuration.h"
#include "Heap.h"
@ -81,6 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void)
OPT_realtyp->size = OPM_RealSize;
OPT_inttyp->size = OPM_IntSize;
OPT_linttyp->size = OPM_LIntSize;
OPT_ainttyp->size = OPM_LIntSize;
OPT_lrltyp->size = OPM_LRealSize;
OPT_sinttyp->size = OPM_SIntSize;
OPT_booltyp->size = OPM_BoolSize;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
typedef

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#ifndef errors__h
#define errors__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "Configuration.h"
#include "Console.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#ifndef extTools__h
#define extTools__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "Console.h"
#include "Strings.h"

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */
#ifndef vt100__h
#define vt100__h