Simplify runtime error reporting and move to platform common source.

This commit is contained in:
David Brown 2016-11-12 10:20:50 +00:00
parent ed7043324d
commit 716240bdd6
205 changed files with 986 additions and 1063 deletions

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */
#define SHORTINT INT8
#define INTEGER INT16
@ -153,7 +153,7 @@ static void Compiler_Trap (INT32 sig)
if (sig == 3) {
Platform_Exit(0);
} else {
if ((sig == 4 && Platform_HaltCode == -15)) {
if (sig == 4) {
OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36);
OPM_LogWLn();
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16
@ -19,6 +19,6 @@ export void *Configuration__init(void)
__DEFMOD;
__REGMOD("Configuration", 0);
/* BEGIN */
__MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75);
__ENDMOD;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Configuration__h
#define Configuration__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
#ifndef Files__h
#define Files__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
#define SHORTINT INT8
#define INTEGER INT16
@ -108,8 +108,8 @@ extern void *Heap__init();
extern ADDRESS Platform_MainStackFrame;
extern ADDRESS Platform_OSAllocate(ADDRESS size);
#define Heap_HeapModuleInit() Heap__init()
#define Heap_ModulesHalt(code) Modules_Halt(code)
#define Heap_OSAllocate(size) Platform_OSAllocate(size)
#define Heap_PlatformHalt(code) Platform_Halt(code)
#define Heap_PlatformMainStackFrame() Platform_MainStackFrame
void Heap_Lock (void)
@ -121,7 +121,7 @@ void Heap_Unlock (void)
{
Heap_lockdepth -= 1;
if ((Heap_interrupted && Heap_lockdepth == 0)) {
Heap_PlatformHalt(-9);
Heap_ModulesHalt(-9);
}
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */
#ifndef Heap__h
#define Heap__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16
@ -7,6 +7,7 @@
#include "SYSTEM.h"
#include "Heap.h"
#include "Platform.h"
typedef
struct Modules_CmdDesc *Modules_Cmd;
@ -47,9 +48,16 @@ export ADDRESS *Modules_ModuleDesc__typ;
export ADDRESS *Modules_CmdDesc__typ;
static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len);
export void Modules_AssertFail (INT32 code);
static void Modules_DisplayHaltCode (INT32 code);
export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all);
export void Modules_Halt (INT32 code);
export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len);
export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len);
static void Modules_errch (CHAR c);
export void Modules_errint (INT32 l);
static void Modules_errposint (INT32 l);
export void Modules_errstring (CHAR *s, LONGINT s__len);
#define Modules_modules() (Modules_Module)Heap_modules
#define Modules_setmodules(m) Heap_modules = m
@ -155,6 +163,121 @@ void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all)
__DEL(name);
}
static void Modules_errch (CHAR c)
{
INT16 e;
e = Platform_Write(1, (ADDRESS)&c, 1);
}
void Modules_errstring (CHAR *s, LONGINT s__len)
{
INT32 i;
__DUP(s, s__len, CHAR);
i = 0;
while ((i < s__len && s[__X(i, s__len)] != 0x00)) {
Modules_errch(s[__X(i, s__len)]);
i += 1;
}
__DEL(s);
}
static void Modules_errposint (INT32 l)
{
if (l > 10) {
Modules_errposint(__DIV(l, 10));
}
Modules_errch((CHAR)(48 + (int)__MOD(l, 10)));
}
void Modules_errint (INT32 l)
{
if (l < 0) {
Modules_errch('-');
l = -l;
}
Modules_errposint(l);
}
static void Modules_DisplayHaltCode (INT32 code)
{
switch (code) {
case -1:
Modules_errstring((CHAR*)"Assertion failure.", 19);
break;
case -2:
Modules_errstring((CHAR*)"Index out of range.", 20);
break;
case -3:
Modules_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49);
break;
case -4:
Modules_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47);
break;
case -5:
Modules_errstring((CHAR*)"Type guard failed.", 19);
break;
case -6:
Modules_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49);
break;
case -7:
Modules_errstring((CHAR*)"Invalid case in WITH statement.", 32);
break;
case -8:
Modules_errstring((CHAR*)"Value out of range.", 20);
break;
case -9:
Modules_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60);
break;
case -10:
Modules_errstring((CHAR*)"NIL access.", 12);
break;
case -11:
Modules_errstring((CHAR*)"Alignment error.", 17);
break;
case -12:
Modules_errstring((CHAR*)"Divide by zero.", 16);
break;
case -13:
Modules_errstring((CHAR*)"Arithmetic overflow/underflow.", 31);
break;
case -14:
Modules_errstring((CHAR*)"Invalid function argument.", 27);
break;
case -15:
Modules_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52);
break;
case -20:
Modules_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60);
break;
default:
break;
}
}
void Modules_Halt (INT32 code)
{
Modules_errstring((CHAR*)"Terminated by Halt(", 20);
Modules_errint(code);
Modules_errstring((CHAR*)"). ", 4);
if (code < 0) {
Modules_DisplayHaltCode(code);
}
Modules_errstring(Platform_NL, 3);
Platform_Exit(code);
}
void Modules_AssertFail (INT32 code)
{
Modules_errstring((CHAR*)"Assertion failure.", 19);
if (code != 0) {
Modules_errstring((CHAR*)" ASSERT code ", 14);
Modules_errint(code);
Modules_errstring((CHAR*)".", 2);
}
Modules_errstring(Platform_NL, 3);
Platform_Exit(code);
}
__TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 64), {0, 32, -24}};
__TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}};
@ -162,6 +285,7 @@ export void *Modules__init(void)
{
__DEFMOD;
__MODULE_IMPORT(Heap);
__MODULE_IMPORT(Platform);
__REGMOD("Modules", 0);
__INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0);
__INITYP(Modules_CmdDesc, Modules_CmdDesc, 0);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Modules__h
#define Modules__h
@ -43,9 +43,13 @@ import Modules_ModuleName Modules_imported, Modules_importing;
import ADDRESS *Modules_ModuleDesc__typ;
import ADDRESS *Modules_CmdDesc__typ;
import void Modules_AssertFail (INT32 code);
import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all);
import void Modules_Halt (INT32 code);
import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len);
import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len);
import void Modules_errint (INT32 l);
import void Modules_errstring (CHAR *s, LONGINT s__len);
import void *Modules__init(void);
#define Modules_modules() (Modules_Module)Heap_modules

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPB__h
#define OPB__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPC__h
#define OPC__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPM__h
#define OPM__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPP__h
#define OPP__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */
#ifndef OPS__h
#define OPS__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPT__h
#define OPT__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef OPV__h
#define OPV__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Out__h
#define Out__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16
@ -49,22 +49,19 @@ export ADDRESS *Platform_FileIdentity__typ;
export BOOLEAN Platform_Absent (INT16 e);
export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len);
export void Platform_AssertFail (INT32 code);
export INT16 Platform_Chdir (CHAR *n, LONGINT n__len);
export INT16 Platform_Close (INT64 h);
export BOOLEAN Platform_ConnectionFailed (INT16 e);
export void Platform_Delay (INT32 ms);
export BOOLEAN Platform_DifferentFilesystems (INT16 e);
static void Platform_DisplayHaltCode (INT32 code);
static void Platform_EnableVT100 (void);
export INT16 Platform_Error (void);
export void Platform_Exit (INT16 code);
export void Platform_Exit (INT32 code);
export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len);
export void Platform_GetClock (INT32 *t, INT32 *d);
export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len);
export void Platform_GetIntArg (INT16 n, INT32 *val);
export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec);
export void Platform_Halt (INT32 code);
export INT16 Platform_Identify (INT64 h, Platform_FileIdentity *identity, ADDRESS *identity__typ);
export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ);
export BOOLEAN Platform_Inaccessible (INT16 e);
@ -84,7 +81,6 @@ export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit
export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2);
export INT16 Platform_Seek (INT64 h, INT32 o, INT16 r);
export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler);
export void Platform_SetHalt (Platform_HaltProcedure p);
export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source);
export INT16 Platform_Size (INT64 h, INT32 *l);
export INT16 Platform_Sync (INT64 h);
@ -97,10 +93,6 @@ export INT16 Platform_Truncate (INT64 h, INT32 limit);
export INT16 Platform_Unlink (CHAR *n, LONGINT n__len);
export INT16 Platform_Write (INT64 h, INT64 p, INT32 l);
static void Platform_YMDHMStoClock (INT16 ye, INT16 mo, INT16 da, INT16 ho, INT16 mi, INT16 se, INT32 *t, INT32 *d);
static void Platform_errch (CHAR c);
static void Platform_errint (INT32 l);
static void Platform_errln (void);
static void Platform_errposint (INT32 l);
export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len);
#include "WindowsWrapper.h"
@ -137,8 +129,6 @@ extern void Heap_InitHeap();
#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)Platform_StdOut, &c, 1, 0,0)
#define Platform_errstring(s, s__len) WriteFile((HANDLE)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)h)
@ -619,128 +609,11 @@ INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len)
__RETCHK;
}
void Platform_Exit (INT16 code)
void Platform_Exit (INT32 code)
{
Platform_exit(code);
}
static void Platform_errch (CHAR c)
{
Platform_errc(c);
}
static void Platform_errln (void)
{
Platform_errch(0x0d);
Platform_errch(0x0a);
}
static void Platform_errposint (INT32 l)
{
if (l > 10) {
Platform_errposint(__DIV(l, 10));
}
Platform_errch((CHAR)(48 + (int)__MOD(l, 10)));
}
static void Platform_errint (INT32 l)
{
if (l < 0) {
Platform_errch('-');
l = -l;
}
Platform_errposint(l);
}
static void Platform_DisplayHaltCode (INT32 code)
{
switch (code) {
case -1:
Platform_errstring((CHAR*)"Assertion failure.", 19);
break;
case -2:
Platform_errstring((CHAR*)"Index out of range.", 20);
break;
case -3:
Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49);
break;
case -4:
Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47);
break;
case -5:
Platform_errstring((CHAR*)"Type guard failed.", 19);
break;
case -6:
Platform_errstring((CHAR*)"Type equality failed.", 22);
break;
case -7:
Platform_errstring((CHAR*)"WITH statement type guard failed.", 34);
break;
case -8:
Platform_errstring((CHAR*)"SHORT: Value too large for shorter type.", 41);
break;
case -9:
Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60);
break;
case -10:
Platform_errstring((CHAR*)"NIL access.", 12);
break;
case -11:
Platform_errstring((CHAR*)"Alignment error.", 17);
break;
case -12:
Platform_errstring((CHAR*)"Divide by zero.", 16);
break;
case -13:
Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31);
break;
case -14:
Platform_errstring((CHAR*)"Invalid function argument.", 27);
break;
case -15:
Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52);
break;
case -20:
Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60);
break;
default:
break;
}
}
void Platform_Halt (INT32 code)
{
Platform_HaltCode = code;
if (Platform_HaltHandler != NIL) {
(*Platform_HaltHandler)(code);
}
Platform_errstring((CHAR*)"Terminated by Halt(", 20);
Platform_errint(code);
Platform_errstring((CHAR*)"). ", 4);
if (code < 0) {
Platform_DisplayHaltCode(code);
}
Platform_errln();
Platform_exit(__VAL(INT16, code));
}
void Platform_AssertFail (INT32 code)
{
Platform_errstring((CHAR*)"Assertion failure.", 19);
if (code != 0) {
Platform_errstring((CHAR*)" ASSERT code ", 14);
Platform_errint(code);
Platform_errstring((CHAR*)".", 2);
}
Platform_errln();
Platform_exit(__VAL(INT16, code));
}
void Platform_SetHalt (Platform_HaltProcedure p)
{
Platform_HaltHandler = p;
}
static void Platform_EnableVT100 (void)
{
INT32 mode;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Platform__h
#define Platform__h
@ -11,9 +11,6 @@ typedef
char _prvt1[16];
} Platform_FileIdentity;
typedef
void (*Platform_HaltProcedure)(INT32);
typedef
void (*Platform_SignalHandler)(INT32);
@ -33,20 +30,18 @@ import ADDRESS *Platform_FileIdentity__typ;
import BOOLEAN Platform_Absent (INT16 e);
import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len);
import void Platform_AssertFail (INT32 code);
import INT16 Platform_Chdir (CHAR *n, LONGINT n__len);
import INT16 Platform_Close (INT64 h);
import BOOLEAN Platform_ConnectionFailed (INT16 e);
import void Platform_Delay (INT32 ms);
import BOOLEAN Platform_DifferentFilesystems (INT16 e);
import INT16 Platform_Error (void);
import void Platform_Exit (INT16 code);
import void Platform_Exit (INT32 code);
import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len);
import void Platform_GetClock (INT32 *t, INT32 *d);
import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len);
import void Platform_GetIntArg (INT16 n, INT32 *val);
import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec);
import void Platform_Halt (INT32 code);
import INT16 Platform_Identify (INT64 h, Platform_FileIdentity *identity, ADDRESS *identity__typ);
import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ);
import BOOLEAN Platform_Inaccessible (INT16 e);
@ -66,7 +61,6 @@ import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit
import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2);
import INT16 Platform_Seek (INT64 h, INT32 o, INT16 r);
import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler);
import void Platform_SetHalt (Platform_HaltProcedure p);
import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source);
import INT16 Platform_Size (INT64 h, INT32 *l);
import INT16 Platform_Sync (INT64 h);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Reals__h
#define Reals__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Strings__h
#define Strings__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef Texts__h
#define Texts__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef VT100__h
#define VT100__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef errors__h
#define errors__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#define SHORTINT INT8
#define INTEGER INT16
@ -7,6 +7,7 @@
#include "SYSTEM.h"
#include "Configuration.h"
#include "Modules.h"
#include "OPM.h"
#include "Out.h"
#include "Platform.h"
@ -53,9 +54,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN
Out_Ln();
}
if (status != 0) {
Platform_Halt(status);
Modules_Halt(status);
} else {
Platform_Halt(exitcode);
Modules_Halt(exitcode);
}
}
__DEL(title);
@ -114,6 +115,7 @@ export void *extTools__init(void)
{
__DEFMOD;
__MODULE_IMPORT(Configuration);
__MODULE_IMPORT(Modules);
__MODULE_IMPORT(OPM);
__MODULE_IMPORT(Out);
__MODULE_IMPORT(Platform);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */
#ifndef extTools__h
#define extTools__h