From ebfc60f49dc74e31c32917979054d17538bd9403 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 6 Sep 2016 20:48:22 +0100 Subject: [PATCH] Define integer sizes before including SYSTEM.h --- bootstrap/unix-44/Configuration.c | 9 +++- bootstrap/unix-44/Configuration.h | 4 +- bootstrap/unix-44/Console.c | 7 ++- bootstrap/unix-44/Console.h | 4 +- bootstrap/unix-44/Files.c | 7 ++- bootstrap/unix-44/Files.h | 4 +- bootstrap/unix-44/Heap.c | 7 ++- bootstrap/unix-44/Heap.h | 6 +-- bootstrap/unix-44/Modules.c | 7 ++- bootstrap/unix-44/Modules.h | 4 +- bootstrap/unix-44/OPB.c | 9 +++- bootstrap/unix-44/OPB.h | 4 +- bootstrap/unix-44/OPC.c | 51 ++++++++++++------- bootstrap/unix-44/OPC.h | 4 +- bootstrap/unix-44/OPM.c | 7 ++- bootstrap/unix-44/OPM.h | 4 +- bootstrap/unix-44/OPP.c | 7 ++- bootstrap/unix-44/OPP.h | 4 +- bootstrap/unix-44/OPS.c | 7 ++- bootstrap/unix-44/OPS.h | 4 +- bootstrap/unix-44/OPT.c | 7 ++- bootstrap/unix-44/OPT.h | 4 +- bootstrap/unix-44/OPV.c | 36 ++++--------- bootstrap/unix-44/OPV.h | 4 +- bootstrap/unix-44/Platform.c | 9 ++-- bootstrap/unix-44/Platform.h | 4 +- bootstrap/unix-44/Reals.c | 7 ++- bootstrap/unix-44/Reals.h | 4 +- bootstrap/unix-44/SYSTEM.h | 43 ++++++++-------- bootstrap/unix-44/Strings.c | 7 ++- bootstrap/unix-44/Strings.h | 4 +- bootstrap/unix-44/Texts.c | 7 ++- bootstrap/unix-44/Texts.h | 6 +-- bootstrap/unix-44/Vishap.c | 7 ++- bootstrap/unix-44/errors.c | 7 ++- bootstrap/unix-44/errors.h | 4 +- bootstrap/unix-44/extTools.c | 7 ++- bootstrap/unix-44/extTools.h | 4 +- bootstrap/unix-44/vt100.c | 7 ++- bootstrap/unix-44/vt100.h | 4 +- bootstrap/unix-48/Configuration.c | 9 +++- bootstrap/unix-48/Configuration.h | 4 +- bootstrap/unix-48/Console.c | 7 ++- bootstrap/unix-48/Console.h | 4 +- bootstrap/unix-48/Files.c | 7 ++- bootstrap/unix-48/Files.h | 4 +- bootstrap/unix-48/Heap.c | 7 ++- bootstrap/unix-48/Heap.h | 6 +-- bootstrap/unix-48/Modules.c | 7 ++- bootstrap/unix-48/Modules.h | 4 +- bootstrap/unix-48/OPB.c | 9 +++- bootstrap/unix-48/OPB.h | 4 +- bootstrap/unix-48/OPC.c | 51 ++++++++++++------- bootstrap/unix-48/OPC.h | 4 +- bootstrap/unix-48/OPM.c | 7 ++- bootstrap/unix-48/OPM.h | 4 +- bootstrap/unix-48/OPP.c | 7 ++- bootstrap/unix-48/OPP.h | 4 +- bootstrap/unix-48/OPS.c | 7 ++- bootstrap/unix-48/OPS.h | 4 +- bootstrap/unix-48/OPT.c | 7 ++- bootstrap/unix-48/OPT.h | 4 +- bootstrap/unix-48/OPV.c | 36 ++++--------- bootstrap/unix-48/OPV.h | 4 +- bootstrap/unix-48/Platform.c | 9 ++-- bootstrap/unix-48/Platform.h | 4 +- bootstrap/unix-48/Reals.c | 7 ++- bootstrap/unix-48/Reals.h | 4 +- bootstrap/unix-48/SYSTEM.h | 43 ++++++++-------- bootstrap/unix-48/Strings.c | 7 ++- bootstrap/unix-48/Strings.h | 4 +- bootstrap/unix-48/Texts.c | 7 ++- bootstrap/unix-48/Texts.h | 8 +-- bootstrap/unix-48/Vishap.c | 7 ++- bootstrap/unix-48/errors.c | 7 ++- bootstrap/unix-48/errors.h | 4 +- bootstrap/unix-48/extTools.c | 7 ++- bootstrap/unix-48/extTools.h | 4 +- bootstrap/unix-48/vt100.c | 7 ++- bootstrap/unix-48/vt100.h | 4 +- bootstrap/unix-88/Configuration.c | 10 ++-- bootstrap/unix-88/Configuration.h | 5 +- bootstrap/unix-88/Console.c | 8 ++- bootstrap/unix-88/Console.h | 5 +- bootstrap/unix-88/Files.c | 8 ++- bootstrap/unix-88/Files.h | 5 +- bootstrap/unix-88/Heap.c | 8 ++- bootstrap/unix-88/Heap.h | 7 ++- bootstrap/unix-88/Modules.c | 8 ++- bootstrap/unix-88/Modules.h | 5 +- bootstrap/unix-88/OPB.c | 10 ++-- bootstrap/unix-88/OPB.h | 5 +- bootstrap/unix-88/OPC.c | 52 ++++++++++++------- bootstrap/unix-88/OPC.h | 5 +- bootstrap/unix-88/OPM.c | 8 ++- bootstrap/unix-88/OPM.h | 5 +- bootstrap/unix-88/OPP.c | 8 ++- bootstrap/unix-88/OPP.h | 5 +- bootstrap/unix-88/OPS.c | 8 ++- bootstrap/unix-88/OPS.h | 5 +- bootstrap/unix-88/OPT.c | 8 ++- bootstrap/unix-88/OPT.h | 5 +- bootstrap/unix-88/OPV.c | 37 ++++---------- bootstrap/unix-88/OPV.h | 5 +- bootstrap/unix-88/Platform.c | 10 ++-- bootstrap/unix-88/Platform.h | 5 +- bootstrap/unix-88/Reals.c | 8 ++- bootstrap/unix-88/Reals.h | 5 +- bootstrap/unix-88/SYSTEM.h | 43 ++++++++-------- bootstrap/unix-88/Strings.c | 8 ++- bootstrap/unix-88/Strings.h | 5 +- bootstrap/unix-88/Texts.c | 8 ++- bootstrap/unix-88/Texts.h | 7 ++- bootstrap/unix-88/Vishap.c | 8 ++- bootstrap/unix-88/errors.c | 8 ++- bootstrap/unix-88/errors.h | 5 +- bootstrap/unix-88/extTools.c | 8 ++- bootstrap/unix-88/extTools.h | 5 +- bootstrap/unix-88/vt100.c | 8 ++- bootstrap/unix-88/vt100.h | 5 +- bootstrap/windows-48/Configuration.c | 9 +++- bootstrap/windows-48/Configuration.h | 4 +- bootstrap/windows-48/Console.c | 7 ++- bootstrap/windows-48/Console.h | 4 +- bootstrap/windows-48/Files.c | 7 ++- bootstrap/windows-48/Files.h | 4 +- bootstrap/windows-48/Heap.c | 7 ++- bootstrap/windows-48/Heap.h | 6 +-- bootstrap/windows-48/Modules.c | 7 ++- bootstrap/windows-48/Modules.h | 4 +- bootstrap/windows-48/OPB.c | 9 +++- bootstrap/windows-48/OPB.h | 4 +- bootstrap/windows-48/OPC.c | 51 ++++++++++++------- bootstrap/windows-48/OPC.h | 4 +- bootstrap/windows-48/OPM.c | 7 ++- bootstrap/windows-48/OPM.h | 4 +- bootstrap/windows-48/OPP.c | 7 ++- bootstrap/windows-48/OPP.h | 4 +- bootstrap/windows-48/OPS.c | 7 ++- bootstrap/windows-48/OPS.h | 4 +- bootstrap/windows-48/OPT.c | 7 ++- bootstrap/windows-48/OPT.h | 4 +- bootstrap/windows-48/OPV.c | 36 ++++--------- bootstrap/windows-48/OPV.h | 4 +- bootstrap/windows-48/Platform.c | 9 ++-- bootstrap/windows-48/Platform.h | 6 +-- bootstrap/windows-48/Reals.c | 7 ++- bootstrap/windows-48/Reals.h | 4 +- bootstrap/windows-48/SYSTEM.h | 43 ++++++++-------- bootstrap/windows-48/Strings.c | 7 ++- bootstrap/windows-48/Strings.h | 4 +- bootstrap/windows-48/Texts.c | 7 ++- bootstrap/windows-48/Texts.h | 8 +-- bootstrap/windows-48/Vishap.c | 7 ++- bootstrap/windows-48/errors.c | 7 ++- bootstrap/windows-48/errors.h | 4 +- bootstrap/windows-48/extTools.c | 7 ++- bootstrap/windows-48/extTools.h | 4 +- bootstrap/windows-48/vt100.c | 7 ++- bootstrap/windows-48/vt100.h | 4 +- bootstrap/windows-88/Configuration.c | 10 ++-- bootstrap/windows-88/Configuration.h | 5 +- bootstrap/windows-88/Console.c | 8 ++- bootstrap/windows-88/Console.h | 5 +- bootstrap/windows-88/Files.c | 8 ++- bootstrap/windows-88/Files.h | 5 +- bootstrap/windows-88/Heap.c | 8 ++- bootstrap/windows-88/Heap.h | 7 ++- bootstrap/windows-88/Modules.c | 8 ++- bootstrap/windows-88/Modules.h | 5 +- bootstrap/windows-88/OPB.c | 10 ++-- bootstrap/windows-88/OPB.h | 5 +- bootstrap/windows-88/OPC.c | 52 ++++++++++++------- bootstrap/windows-88/OPC.h | 5 +- bootstrap/windows-88/OPM.c | 8 ++- bootstrap/windows-88/OPM.h | 5 +- bootstrap/windows-88/OPP.c | 8 ++- bootstrap/windows-88/OPP.h | 5 +- bootstrap/windows-88/OPS.c | 8 ++- bootstrap/windows-88/OPS.h | 5 +- bootstrap/windows-88/OPT.c | 8 ++- bootstrap/windows-88/OPT.h | 5 +- bootstrap/windows-88/OPV.c | 37 ++++---------- bootstrap/windows-88/OPV.h | 5 +- bootstrap/windows-88/Platform.c | 10 ++-- bootstrap/windows-88/Platform.h | 7 ++- bootstrap/windows-88/Reals.c | 8 ++- bootstrap/windows-88/Reals.h | 5 +- bootstrap/windows-88/SYSTEM.h | 43 ++++++++-------- bootstrap/windows-88/Strings.c | 8 ++- bootstrap/windows-88/Strings.h | 5 +- bootstrap/windows-88/Texts.c | 8 ++- bootstrap/windows-88/Texts.h | 7 ++- bootstrap/windows-88/Vishap.c | 8 ++- bootstrap/windows-88/errors.c | 8 ++- bootstrap/windows-88/errors.h | 5 +- bootstrap/windows-88/extTools.c | 8 ++- bootstrap/windows-88/extTools.h | 5 +- bootstrap/windows-88/vt100.c | 8 ++- bootstrap/windows-88/vt100.h | 5 +- src/compiler/OPB.Mod | 2 +- src/compiler/OPC.Mod | 76 +++++++++++++++++++--------- src/compiler/OPM.cmdln.Mod | 8 +-- src/compiler/OPV.Mod | 16 +----- src/system/Platformunix.Mod | 2 - src/system/Platformwindows.Mod | 2 - src/system/SYSTEM.h | 43 ++++++++-------- src/tools/make/configure.c | 6 +++ 208 files changed, 1164 insertions(+), 787 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 560d018b..115f8dec 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" @@ -13,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index ac266eec..84e8427b 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h @@ -12,4 +12,4 @@ import CHAR Configuration_versionLong[41]; import void *Configuration__init(void); -#endif +#endif // Configuration diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 7a2cc9d0..8cbc9ce9 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index fd32774b..e9913d2d 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h @@ -20,4 +20,4 @@ import void Console_String (CHAR *s, LONGINT s__len); import void *Console__init(void); -#endif +#endif // Console diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 87b9a0a5..d596986e 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 4fc7ce7e..b0f34806 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h @@ -67,4 +67,4 @@ import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT import void *Files__init(void); -#endif +#endif // Files diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 02e6f1cb..2bbe63b2 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index ca1d8e95..6694ef70 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -22,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[44]; } Heap_ModuleDesc; @@ -51,4 +51,4 @@ import void Heap_Unlock (void); import void *Heap__init(void); -#endif +#endif // Heap diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index fab3561e..e31876fb 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 13abd6d0..4bd4082d 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h @@ -51,4 +51,4 @@ import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -#endif +#endif // Modules diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 1d0b8774..0a1a9f63 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -1912,7 +1917,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != OPM_LIntSize) { + if (x->typ->size != OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 465ba585..5ffa3869 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h @@ -46,4 +46,4 @@ import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); -#endif +#endif // OPB diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index b702852c..5666c7cd 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -834,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize)); OPC_EndStat(); } @@ -917,12 +922,20 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", 8); - } else if (align == OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", 8); - } else if (align == OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", 9); + switch (align) { + case 2: + OPM_WriteString((CHAR*)"int16", 6); + break; + case 4: + OPM_WriteString((CHAR*)"int32", 6); + break; + case 8: + OPM_WriteString((CHAR*)"int64", 6); + break; + default: + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Unexpected enclosing alignment in FillGap.", 43); + break; } OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; @@ -1210,7 +1223,8 @@ void OPC_GenHdr (OPT_Node n) OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", 7); + OPM_WriteString((CHAR*)"#endif // ", 11); + OPM_WriteStringVar((void*)OPM_modName, 32); OPM_WriteLn(); } @@ -1297,10 +1311,6 @@ void OPC_GenHdrIncludes (void) OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); @@ -1310,10 +1320,17 @@ void OPC_GenBdy (OPT_Node n) { OPM_currFile = 1; OPC_GenHeaderMsg(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); + OPM_WriteLn(); + OPM_WriteLn(); OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 2839fb0f..e1fc08ec 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -48,4 +48,4 @@ import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); -#endif +#endif // OPC diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 70121d63..461b5b85 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index fce4bdd3..c60f6f98 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -62,4 +62,4 @@ import void OPM_err (int16 n); import void *OPM__init(void); -#endif +#endif // OPM diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index dc286221..1ab60658 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index e79b5819..ce85af11 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h @@ -13,4 +13,4 @@ import void OPP_Module (OPT_Node *prog, SET opt); import void *OPP__init(void); -#endif +#endif // OPP diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index b90cb34b..3a1c4787 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 347c669a..512cfa75 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h @@ -25,4 +25,4 @@ import void OPS_Init (void); import void *OPS__init(void); -#endif +#endif // OPS diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index ccfba447..1983daf5 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index ce146e6f..d3b24cc6 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -103,4 +103,4 @@ import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import void *OPT__init(void); -#endif +#endif // OPT diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index da9a8429..a62894dd 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -16,7 +21,6 @@ static int16 OPV_stamp; static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; -static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -34,7 +38,6 @@ export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); static void OPV_Len (OPT_Node n, int32 dim); export void OPV_Module (OPT_Node prog); -static int32 OPV_NaturalAlignment (int32 size, int32 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int32 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); @@ -51,24 +54,6 @@ static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static int32 OPV_NaturalAlignment (int32 size, int32 max) -{ - int32 _o_result; - int32 i; - if (size >= max) { - _o_result = max; - return _o_result; - } else { - i = 1; - while (i < size) { - i += i; - } - _o_result = i; - return _o_result; - } - __RETCHK; -} - void OPV_TypSize (OPT_Struct typ) { int16 f, c; @@ -108,9 +93,6 @@ void OPV_TypSize (OPT_Struct typ) if (offset == 0) { offset = 1; } - if (OPM_RecSize == 0) { - base = OPV_NaturalAlignment(offset, OPC_SizeAlignment(OPM_RecSize)); - } OPC_Align(&offset, base); if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { OPV_recno += 1; @@ -568,7 +550,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPT_Struct typ = NIL; int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__28; + int16 dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -644,9 +626,9 @@ static void OPV_design (OPT_Node n, int16 prec) } x = x->left; } - _for__28 = dims; + _for__27 = dims; i = 1; - while (i <= _for__28) { + while (i <= _for__27) { OPM_Write(')'); i += 1; } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 600b19bd..b10704dc 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h @@ -16,4 +16,4 @@ import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); -#endif +#endif // OPV diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 056a333c..43761270 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" typedef @@ -728,7 +733,6 @@ static void Platform_DisplayHaltCode (int32 code) void Platform_Halt (int32 code) { - int16 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -745,7 +749,6 @@ void Platform_Halt (int32 code) void Platform_AssertFail (int32 code) { - int16 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index ab1d3003..0f9c0290 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -80,4 +80,4 @@ import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT import void *Platform__init(void); -#endif +#endif // Platform diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 8fe37010..5f3d11a5 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 9ebc1c17..cf931556 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h @@ -20,4 +20,4 @@ import LONGREAL Reals_TenL (int16 e); import void *Reals__init(void); -#endif +#endif // Reals diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 8c6c335e..6fc57309 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -1,6 +1,24 @@ #ifndef SYSTEM__h #define SYSTEM__h + + +#ifndef LONGINT + #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #define INTEGER int32 + #define LONGINT int64 + #define SET uint64 + #else + #define INTEGER int16 + #define LONGINT int32 + #define SET uint32 + #endif +#endif + + + + + // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. @@ -22,10 +40,12 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if defined(_WIN64) +#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) + // ILP32 or LLP64 typedef long long int64; typedef unsigned long long uint64; #else + // LP64 typedef long int64; typedef unsigned long uint64; #endif @@ -67,29 +87,10 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; +#define uSET SET -// For 32 bit builds, the size of LONGINT depends on a make option: - -#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int32 INTEGER; - typedef int64 LONGINT; - typedef uint64 SET; - typedef uint64 uSET; -#else - typedef int16 INTEGER; - typedef int32 LONGINT; - typedef uint32 SET; - typedef uint32 uSET; -#endif - - -// Temporary defs while bootstrapping - -#define uLONGINT uint64 - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index a642190c..7e1a6845 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index f537406e..59076121 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h @@ -20,4 +20,4 @@ import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR import void *Strings__init(void); -#endif +#endif // Strings diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 8b4c3700..9314c178 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 4444900f..ce868328 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h @@ -30,7 +30,7 @@ typedef typedef struct Texts_RunDesc { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[15]; } Texts_RunDesc; @@ -169,4 +169,4 @@ import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGIN import void *Texts__init(void); -#endif +#endif // Texts diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 81b2d70f..549268e2 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index a5576d43..a2f7cf75 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 696219d4..bf0e9564 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h @@ -15,4 +15,4 @@ import errors_string errors_errors[350]; import void *errors__init(void); -#endif +#endif // errors diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 553a3d7d..27ef9f8f 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index ba9937e8..c5d5c772 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h @@ -13,4 +13,4 @@ import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEA import void *extTools__init(void); -#endif +#endif // extTools diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index ab305ed1..912e5e83 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 71079dc0..36c0bc7e 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h @@ -34,4 +34,4 @@ import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); -#endif +#endif // vt100 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 560d018b..115f8dec 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" @@ -13,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index ac266eec..84e8427b 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h @@ -12,4 +12,4 @@ import CHAR Configuration_versionLong[41]; import void *Configuration__init(void); -#endif +#endif // Configuration diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 7a2cc9d0..8cbc9ce9 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index fd32774b..e9913d2d 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h @@ -20,4 +20,4 @@ import void Console_String (CHAR *s, LONGINT s__len); import void *Console__init(void); -#endif +#endif // Console diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 87b9a0a5..d596986e 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 4fc7ce7e..b0f34806 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h @@ -67,4 +67,4 @@ import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT import void *Files__init(void); -#endif +#endif // Files diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 02e6f1cb..2bbe63b2 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index ca1d8e95..6694ef70 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -22,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[44]; } Heap_ModuleDesc; @@ -51,4 +51,4 @@ import void Heap_Unlock (void); import void *Heap__init(void); -#endif +#endif // Heap diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index fab3561e..e31876fb 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 13abd6d0..4bd4082d 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h @@ -51,4 +51,4 @@ import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -#endif +#endif // Modules diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 1d0b8774..0a1a9f63 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -1912,7 +1917,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != OPM_LIntSize) { + if (x->typ->size != OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 465ba585..5ffa3869 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h @@ -46,4 +46,4 @@ import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); -#endif +#endif // OPB diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index b702852c..5666c7cd 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -834,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize)); OPC_EndStat(); } @@ -917,12 +922,20 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", 8); - } else if (align == OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", 8); - } else if (align == OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", 9); + switch (align) { + case 2: + OPM_WriteString((CHAR*)"int16", 6); + break; + case 4: + OPM_WriteString((CHAR*)"int32", 6); + break; + case 8: + OPM_WriteString((CHAR*)"int64", 6); + break; + default: + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Unexpected enclosing alignment in FillGap.", 43); + break; } OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; @@ -1210,7 +1223,8 @@ void OPC_GenHdr (OPT_Node n) OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", 7); + OPM_WriteString((CHAR*)"#endif // ", 11); + OPM_WriteStringVar((void*)OPM_modName, 32); OPM_WriteLn(); } @@ -1297,10 +1311,6 @@ void OPC_GenHdrIncludes (void) OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); @@ -1310,10 +1320,17 @@ void OPC_GenBdy (OPT_Node n) { OPM_currFile = 1; OPC_GenHeaderMsg(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); + OPM_WriteLn(); + OPM_WriteLn(); OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 2839fb0f..e1fc08ec 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -48,4 +48,4 @@ import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); -#endif +#endif // OPC diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 70121d63..461b5b85 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index fce4bdd3..c60f6f98 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -62,4 +62,4 @@ import void OPM_err (int16 n); import void *OPM__init(void); -#endif +#endif // OPM diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index dc286221..1ab60658 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index e79b5819..ce85af11 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h @@ -13,4 +13,4 @@ import void OPP_Module (OPT_Node *prog, SET opt); import void *OPP__init(void); -#endif +#endif // OPP diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index b90cb34b..3a1c4787 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 347c669a..512cfa75 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h @@ -25,4 +25,4 @@ import void OPS_Init (void); import void *OPS__init(void); -#endif +#endif // OPS diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index ccfba447..1983daf5 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index ce146e6f..d3b24cc6 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -103,4 +103,4 @@ import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import void *OPT__init(void); -#endif +#endif // OPT diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index da9a8429..a62894dd 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -16,7 +21,6 @@ static int16 OPV_stamp; static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; -static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -34,7 +38,6 @@ export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); static void OPV_Len (OPT_Node n, int32 dim); export void OPV_Module (OPT_Node prog); -static int32 OPV_NaturalAlignment (int32 size, int32 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int32 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); @@ -51,24 +54,6 @@ static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static int32 OPV_NaturalAlignment (int32 size, int32 max) -{ - int32 _o_result; - int32 i; - if (size >= max) { - _o_result = max; - return _o_result; - } else { - i = 1; - while (i < size) { - i += i; - } - _o_result = i; - return _o_result; - } - __RETCHK; -} - void OPV_TypSize (OPT_Struct typ) { int16 f, c; @@ -108,9 +93,6 @@ void OPV_TypSize (OPT_Struct typ) if (offset == 0) { offset = 1; } - if (OPM_RecSize == 0) { - base = OPV_NaturalAlignment(offset, OPC_SizeAlignment(OPM_RecSize)); - } OPC_Align(&offset, base); if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { OPV_recno += 1; @@ -568,7 +550,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPT_Struct typ = NIL; int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__28; + int16 dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -644,9 +626,9 @@ static void OPV_design (OPT_Node n, int16 prec) } x = x->left; } - _for__28 = dims; + _for__27 = dims; i = 1; - while (i <= _for__28) { + while (i <= _for__27) { OPM_Write(')'); i += 1; } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 600b19bd..b10704dc 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h @@ -16,4 +16,4 @@ import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); -#endif +#endif // OPV diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 056a333c..43761270 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" typedef @@ -728,7 +733,6 @@ static void Platform_DisplayHaltCode (int32 code) void Platform_Halt (int32 code) { - int16 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -745,7 +749,6 @@ void Platform_Halt (int32 code) void Platform_AssertFail (int32 code) { - int16 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index ab1d3003..0f9c0290 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -80,4 +80,4 @@ import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT import void *Platform__init(void); -#endif +#endif // Platform diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 8fe37010..5f3d11a5 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 9ebc1c17..cf931556 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h @@ -20,4 +20,4 @@ import LONGREAL Reals_TenL (int16 e); import void *Reals__init(void); -#endif +#endif // Reals diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 8c6c335e..6fc57309 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -1,6 +1,24 @@ #ifndef SYSTEM__h #define SYSTEM__h + + +#ifndef LONGINT + #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #define INTEGER int32 + #define LONGINT int64 + #define SET uint64 + #else + #define INTEGER int16 + #define LONGINT int32 + #define SET uint32 + #endif +#endif + + + + + // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. @@ -22,10 +40,12 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if defined(_WIN64) +#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) + // ILP32 or LLP64 typedef long long int64; typedef unsigned long long uint64; #else + // LP64 typedef long int64; typedef unsigned long uint64; #endif @@ -67,29 +87,10 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; +#define uSET SET -// For 32 bit builds, the size of LONGINT depends on a make option: - -#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int32 INTEGER; - typedef int64 LONGINT; - typedef uint64 SET; - typedef uint64 uSET; -#else - typedef int16 INTEGER; - typedef int32 LONGINT; - typedef uint32 SET; - typedef uint32 uSET; -#endif - - -// Temporary defs while bootstrapping - -#define uLONGINT uint64 - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index a642190c..7e1a6845 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index f537406e..59076121 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h @@ -20,4 +20,4 @@ import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR import void *Strings__init(void); -#endif +#endif // Strings diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index b218c1b0..a4267893 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 3174aa9b..2238689d 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h @@ -30,7 +30,7 @@ typedef typedef struct Texts_RunDesc { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[15]; } Texts_RunDesc; @@ -86,7 +86,7 @@ typedef Texts_FontsFont fnt; int8 col, voff; Texts_Elem elem; - LONGREAL _prvt0; + int64 _prvt0; char _prvt1[24]; CHAR nextCh; int16 line, class; @@ -170,4 +170,4 @@ import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGIN import void *Texts__init(void); -#endif +#endif // Texts diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 81b2d70f..549268e2 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index a5576d43..a2f7cf75 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 696219d4..bf0e9564 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h @@ -15,4 +15,4 @@ import errors_string errors_errors[350]; import void *errors__init(void); -#endif +#endif // errors diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 553a3d7d..27ef9f8f 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index ba9937e8..c5d5c772 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h @@ -13,4 +13,4 @@ import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEA import void *extTools__init(void); -#endif +#endif // extTools diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index ab305ed1..912e5e83 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 71079dc0..36c0bc7e 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h @@ -34,4 +34,4 @@ import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); -#endif +#endif // vt100 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index c0502177..cfce02b8 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" @@ -14,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 73002e87..84e8427b 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h -#define LARGE #include "SYSTEM.h" @@ -13,4 +12,4 @@ import CHAR Configuration_versionLong[41]; import void *Configuration__init(void); -#endif +#endif // Configuration diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 13a36e69..3dc7b5ab 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index bcf5714f..1f1182fd 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h -#define LARGE #include "SYSTEM.h" @@ -21,4 +20,4 @@ import void Console_String (CHAR *s, LONGINT s__len); import void *Console__init(void); -#endif +#endif // Console diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 0633202c..29b0069e 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 340af571..60221720 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h -#define LARGE #include "SYSTEM.h" typedef @@ -68,4 +67,4 @@ import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT import void *Files__init(void); -#endif +#endif // Files diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index b5749b04..1fe3ce13 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index b547af41..def46dcf 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h -#define LARGE #include "SYSTEM.h" typedef @@ -23,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - LONGINT _prvt0; + int64 _prvt0; char _prvt1[72]; } Heap_ModuleDesc; @@ -52,4 +51,4 @@ import void Heap_Unlock (void); import void *Heap__init(void); -#endif +#endif // Heap diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index bce66b2e..9d93e3d2 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 544820fd..f9e49aa7 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h -#define LARGE #include "SYSTEM.h" typedef @@ -52,4 +51,4 @@ import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -#endif +#endif // Modules diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 1414fc79..11b9a1a9 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -1913,7 +1917,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != (int64)OPM_LIntSize) { + if (x->typ->size != OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 718d88bb..c3c5c1e8 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h -#define LARGE #include "SYSTEM.h" #include "OPS.h" #include "OPT.h" @@ -47,4 +46,4 @@ import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); -#endif +#endif // OPB diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index fad896b9..e971762c 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -835,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_PointerSize)); OPC_EndStat(); } @@ -918,12 +922,20 @@ static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *cur if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (int64)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", 8); - } else if (align == (int64)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", 8); - } else if (align == (int64)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", 9); + switch (align) { + case 2: + OPM_WriteString((CHAR*)"int16", 6); + break; + case 4: + OPM_WriteString((CHAR*)"int32", 6); + break; + case 8: + OPM_WriteString((CHAR*)"int64", 6); + break; + default: + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Unexpected enclosing alignment in FillGap.", 43); + break; } OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; @@ -1211,7 +1223,8 @@ void OPC_GenHdr (OPT_Node n) OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", 7); + OPM_WriteString((CHAR*)"#endif // ", 11); + OPM_WriteStringVar((void*)OPM_modName, 32); OPM_WriteLn(); } @@ -1298,10 +1311,6 @@ void OPC_GenHdrIncludes (void) OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); @@ -1311,10 +1320,17 @@ void OPC_GenBdy (OPT_Node n) { OPM_currFile = 1; OPC_GenHeaderMsg(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); + OPM_WriteLn(); + OPM_WriteLn(); OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index ac5c7677..a218490a 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h -#define LARGE #include "SYSTEM.h" #include "OPT.h" @@ -49,4 +48,4 @@ import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); -#endif +#endif // OPC diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index f410e6d3..389fda93 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index cc77f079..51042a0e 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h -#define LARGE #include "SYSTEM.h" @@ -63,4 +62,4 @@ import void OPM_err (int32 n); import void *OPM__init(void); -#endif +#endif // OPM diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 6c3c14fe..9ab86b22 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 9aba4ad7..ce85af11 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h -#define LARGE #include "SYSTEM.h" #include "OPT.h" @@ -14,4 +13,4 @@ import void OPP_Module (OPT_Node *prog, SET opt); import void *OPP__init(void); -#endif +#endif // OPP diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index e0988fb0..8e53d027 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 1601514e..ffbc5084 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h -#define LARGE #include "SYSTEM.h" typedef @@ -26,4 +25,4 @@ import void OPS_Init (void); import void *OPS__init(void); -#endif +#endif // OPS diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index c08c86af..bd27c789 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index f50911dd..583c31ff 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h -#define LARGE #include "SYSTEM.h" #include "OPS.h" @@ -104,4 +103,4 @@ import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); import void *OPT__init(void); -#endif +#endif // OPT diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index b8c77e55..2d81dd31 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -17,7 +21,6 @@ static int32 OPV_stamp; static int64 OPV_recno; static OPV_ExitInfo OPV_exit; static int32 OPV_nofExitLabels; -static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -35,7 +38,6 @@ export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); static void OPV_Len (OPT_Node n, int64 dim); export void OPV_Module (OPT_Node prog); -static int64 OPV_NaturalAlignment (int64 size, int64 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int64 n, int64 size); static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp); @@ -52,24 +54,6 @@ static void OPV_expr (OPT_Node n, int32 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static int64 OPV_NaturalAlignment (int64 size, int64 max) -{ - int64 _o_result; - int64 i; - if (size >= max) { - _o_result = max; - return _o_result; - } else { - i = 1; - while (i < size) { - i += i; - } - _o_result = i; - return _o_result; - } - __RETCHK; -} - void OPV_TypSize (OPT_Struct typ) { int32 f, c; @@ -109,9 +93,6 @@ void OPV_TypSize (OPT_Struct typ) if (offset == 0) { offset = 1; } - if (OPM_RecSize == 0) { - base = OPV_NaturalAlignment(offset, OPC_SizeAlignment(OPM_RecSize)); - } OPC_Align(&offset, base); if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { OPV_recno += 1; @@ -569,7 +550,7 @@ static void OPV_design (OPT_Node n, int32 prec) OPT_Struct typ = NIL; int32 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int32 dims, i, _for__28; + int32 dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -645,9 +626,9 @@ static void OPV_design (OPT_Node n, int32 prec) } x = x->left; } - _for__28 = dims; + _for__27 = dims; i = 1; - while (i <= _for__28) { + while (i <= _for__27) { OPM_Write(')'); i += 1; } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 92c13a0a..b10704dc 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h -#define LARGE #include "SYSTEM.h" #include "OPT.h" @@ -17,4 +16,4 @@ import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); -#endif +#endif // OPV diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 0aab8de3..70c9bcb7 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" typedef @@ -729,7 +733,6 @@ static void Platform_DisplayHaltCode (int64 code) void Platform_Halt (int64 code) { - int32 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -746,7 +749,6 @@ void Platform_Halt (int64 code) void Platform_AssertFail (int64 code) { - int32 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 324566bf..1ffe3227 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h -#define LARGE #include "SYSTEM.h" typedef @@ -81,4 +80,4 @@ import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT import void *Platform__init(void); -#endif +#endif // Platform diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 80ca4829..0b5761ee 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index da0c1f86..dfc56cef 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h -#define LARGE #include "SYSTEM.h" @@ -21,4 +20,4 @@ import LONGREAL Reals_TenL (int32 e); import void *Reals__init(void); -#endif +#endif // Reals diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 8c6c335e..6fc57309 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -1,6 +1,24 @@ #ifndef SYSTEM__h #define SYSTEM__h + + +#ifndef LONGINT + #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #define INTEGER int32 + #define LONGINT int64 + #define SET uint64 + #else + #define INTEGER int16 + #define LONGINT int32 + #define SET uint32 + #endif +#endif + + + + + // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. @@ -22,10 +40,12 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if defined(_WIN64) +#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) + // ILP32 or LLP64 typedef long long int64; typedef unsigned long long uint64; #else + // LP64 typedef long int64; typedef unsigned long uint64; #endif @@ -67,29 +87,10 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; +#define uSET SET -// For 32 bit builds, the size of LONGINT depends on a make option: - -#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int32 INTEGER; - typedef int64 LONGINT; - typedef uint64 SET; - typedef uint64 uSET; -#else - typedef int16 INTEGER; - typedef int32 LONGINT; - typedef uint32 SET; - typedef uint32 uSET; -#endif - - -// Temporary defs while bootstrapping - -#define uLONGINT uint64 - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index f240e3b4..39f247ba 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 88b212f1..2c6a801d 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h -#define LARGE #include "SYSTEM.h" @@ -21,4 +20,4 @@ import void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR import void *Strings__init(void); -#endif +#endif // Strings diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 59d184b4..a78b77bb 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index d779d5d5..7156eb22 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h -#define LARGE #include "SYSTEM.h" #include "Files.h" @@ -31,7 +30,7 @@ typedef typedef struct Texts_RunDesc { - LONGINT _prvt0; + int64 _prvt0; char _prvt1[27]; } Texts_RunDesc; @@ -170,4 +169,4 @@ import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGIN import void *Texts__init(void); -#endif +#endif // Texts diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 7a2484a5..46a95ea9 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 1d7e852f..9c9ed747 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index f917a7b6..bf0e9564 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h -#define LARGE #include "SYSTEM.h" typedef @@ -16,4 +15,4 @@ import errors_string errors_errors[350]; import void *errors__init(void); -#endif +#endif // errors diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index d656f5be..c3dc490a 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 1f0bb8e7..c5d5c772 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h -#define LARGE #include "SYSTEM.h" @@ -14,4 +13,4 @@ import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEA import void *extTools__init(void); -#endif +#endif // extTools diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 22698256..fac0e0ba 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index f6c994fa..c2ebcd84 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h -#define LARGE #include "SYSTEM.h" @@ -35,4 +34,4 @@ import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); -#endif +#endif // vt100 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 560d018b..115f8dec 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" @@ -13,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index ac266eec..84e8427b 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h @@ -12,4 +12,4 @@ import CHAR Configuration_versionLong[41]; import void *Configuration__init(void); -#endif +#endif // Configuration diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 5b34dfb9..0b87cb07 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index fd32774b..e9913d2d 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h @@ -20,4 +20,4 @@ import void Console_String (CHAR *s, LONGINT s__len); import void *Console__init(void); -#endif +#endif // Console diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 0957fcfb..930aa8c9 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 01dff049..55b2a130 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h @@ -67,4 +67,4 @@ import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT import void *Files__init(void); -#endif +#endif // Files diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 02e6f1cb..2bbe63b2 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index ca1d8e95..6694ef70 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -22,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[44]; } Heap_ModuleDesc; @@ -51,4 +51,4 @@ import void Heap_Unlock (void); import void *Heap__init(void); -#endif +#endif // Heap diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index fab3561e..e31876fb 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 13abd6d0..4bd4082d 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h @@ -51,4 +51,4 @@ import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -#endif +#endif // Modules diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 1d0b8774..0a1a9f63 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -1912,7 +1917,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != OPM_LIntSize) { + if (x->typ->size != OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 465ba585..5ffa3869 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h @@ -46,4 +46,4 @@ import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); -#endif +#endif // OPB diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index b702852c..5666c7cd 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -834,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize)); OPC_EndStat(); } @@ -917,12 +922,20 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", 8); - } else if (align == OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", 8); - } else if (align == OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", 9); + switch (align) { + case 2: + OPM_WriteString((CHAR*)"int16", 6); + break; + case 4: + OPM_WriteString((CHAR*)"int32", 6); + break; + case 8: + OPM_WriteString((CHAR*)"int64", 6); + break; + default: + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Unexpected enclosing alignment in FillGap.", 43); + break; } OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; @@ -1210,7 +1223,8 @@ void OPC_GenHdr (OPT_Node n) OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", 7); + OPM_WriteString((CHAR*)"#endif // ", 11); + OPM_WriteStringVar((void*)OPM_modName, 32); OPM_WriteLn(); } @@ -1297,10 +1311,6 @@ void OPC_GenHdrIncludes (void) OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); @@ -1310,10 +1320,17 @@ void OPC_GenBdy (OPT_Node n) { OPM_currFile = 1; OPC_GenHeaderMsg(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); + OPM_WriteLn(); + OPM_WriteLn(); OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 2839fb0f..e1fc08ec 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -48,4 +48,4 @@ import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); -#endif +#endif // OPC diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 70121d63..461b5b85 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index fce4bdd3..c60f6f98 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -62,4 +62,4 @@ import void OPM_err (int16 n); import void *OPM__init(void); -#endif +#endif // OPM diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index dc286221..1ab60658 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index e79b5819..ce85af11 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h @@ -13,4 +13,4 @@ import void OPP_Module (OPT_Node *prog, SET opt); import void *OPP__init(void); -#endif +#endif // OPP diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index b90cb34b..3a1c4787 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 347c669a..512cfa75 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h @@ -25,4 +25,4 @@ import void OPS_Init (void); import void *OPS__init(void); -#endif +#endif // OPS diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index ccfba447..1983daf5 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index ce146e6f..d3b24cc6 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -103,4 +103,4 @@ import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import void *OPT__init(void); -#endif +#endif // OPT diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index da9a8429..a62894dd 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -16,7 +21,6 @@ static int16 OPV_stamp; static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; -static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -34,7 +38,6 @@ export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); static void OPV_Len (OPT_Node n, int32 dim); export void OPV_Module (OPT_Node prog); -static int32 OPV_NaturalAlignment (int32 size, int32 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int32 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); @@ -51,24 +54,6 @@ static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static int32 OPV_NaturalAlignment (int32 size, int32 max) -{ - int32 _o_result; - int32 i; - if (size >= max) { - _o_result = max; - return _o_result; - } else { - i = 1; - while (i < size) { - i += i; - } - _o_result = i; - return _o_result; - } - __RETCHK; -} - void OPV_TypSize (OPT_Struct typ) { int16 f, c; @@ -108,9 +93,6 @@ void OPV_TypSize (OPT_Struct typ) if (offset == 0) { offset = 1; } - if (OPM_RecSize == 0) { - base = OPV_NaturalAlignment(offset, OPC_SizeAlignment(OPM_RecSize)); - } OPC_Align(&offset, base); if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { OPV_recno += 1; @@ -568,7 +550,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPT_Struct typ = NIL; int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__28; + int16 dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -644,9 +626,9 @@ static void OPV_design (OPT_Node n, int16 prec) } x = x->left; } - _for__28 = dims; + _for__27 = dims; i = 1; - while (i <= _for__28) { + while (i <= _for__27) { OPM_Write(')'); i += 1; } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 600b19bd..b10704dc 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h @@ -16,4 +16,4 @@ import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); -#endif +#endif // OPV diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 62a367e1..bdf72323 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" typedef @@ -774,7 +779,6 @@ static void Platform_DisplayHaltCode (int32 code) void Platform_Halt (int32 code) { - int16 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -791,7 +795,6 @@ void Platform_Halt (int32 code) void Platform_AssertFail (int32 code) { - int16 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 0b6a48d8..d1466be1 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -7,7 +7,7 @@ typedef struct Platform_FileIdentity { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[16]; } Platform_FileIdentity; @@ -82,4 +82,4 @@ import void *Platform__init(void); #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) -#endif +#endif // Platform diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 8fe37010..5f3d11a5 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 9ebc1c17..cf931556 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h @@ -20,4 +20,4 @@ import LONGREAL Reals_TenL (int16 e); import void *Reals__init(void); -#endif +#endif // Reals diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 8c6c335e..6fc57309 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -1,6 +1,24 @@ #ifndef SYSTEM__h #define SYSTEM__h + + +#ifndef LONGINT + #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #define INTEGER int32 + #define LONGINT int64 + #define SET uint64 + #else + #define INTEGER int16 + #define LONGINT int32 + #define SET uint32 + #endif +#endif + + + + + // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. @@ -22,10 +40,12 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if defined(_WIN64) +#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) + // ILP32 or LLP64 typedef long long int64; typedef unsigned long long uint64; #else + // LP64 typedef long int64; typedef unsigned long uint64; #endif @@ -67,29 +87,10 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; +#define uSET SET -// For 32 bit builds, the size of LONGINT depends on a make option: - -#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int32 INTEGER; - typedef int64 LONGINT; - typedef uint64 SET; - typedef uint64 uSET; -#else - typedef int16 INTEGER; - typedef int32 LONGINT; - typedef uint32 SET; - typedef uint32 uSET; -#endif - - -// Temporary defs while bootstrapping - -#define uLONGINT uint64 - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index a642190c..7e1a6845 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index f537406e..59076121 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h @@ -20,4 +20,4 @@ import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR import void *Strings__init(void); -#endif +#endif // Strings diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index b218c1b0..a4267893 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 3174aa9b..2238689d 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h @@ -30,7 +30,7 @@ typedef typedef struct Texts_RunDesc { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[15]; } Texts_RunDesc; @@ -86,7 +86,7 @@ typedef Texts_FontsFont fnt; int8 col, voff; Texts_Elem elem; - LONGREAL _prvt0; + int64 _prvt0; char _prvt1[24]; CHAR nextCh; int16 line, class; @@ -170,4 +170,4 @@ import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGIN import void *Texts__init(void); -#endif +#endif // Texts diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 81b2d70f..549268e2 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index a5576d43..a2f7cf75 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 696219d4..bf0e9564 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h @@ -15,4 +15,4 @@ import errors_string errors_errors[350]; import void *errors__init(void); -#endif +#endif // errors diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 553a3d7d..27ef9f8f 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index ba9937e8..c5d5c772 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h @@ -13,4 +13,4 @@ import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEA import void *extTools__init(void); -#endif +#endif // extTools diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index ab305ed1..912e5e83 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 71079dc0..36c0bc7e 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h @@ -34,4 +34,4 @@ import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); -#endif +#endif // vt100 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index c0502177..cfce02b8 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" @@ -14,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 73002e87..84e8427b 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h -#define LARGE #include "SYSTEM.h" @@ -13,4 +12,4 @@ import CHAR Configuration_versionLong[41]; import void *Configuration__init(void); -#endif +#endif // Configuration diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 83c649cf..c9058a13 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index bcf5714f..1f1182fd 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h -#define LARGE #include "SYSTEM.h" @@ -21,4 +20,4 @@ import void Console_String (CHAR *s, LONGINT s__len); import void *Console__init(void); -#endif +#endif // Console diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 1f5e58a0..61842215 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 65de586e..2c581e47 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h -#define LARGE #include "SYSTEM.h" typedef @@ -68,4 +67,4 @@ import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT import void *Files__init(void); -#endif +#endif // Files diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index b5749b04..1fe3ce13 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index b547af41..def46dcf 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h -#define LARGE #include "SYSTEM.h" typedef @@ -23,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - LONGINT _prvt0; + int64 _prvt0; char _prvt1[72]; } Heap_ModuleDesc; @@ -52,4 +51,4 @@ import void Heap_Unlock (void); import void *Heap__init(void); -#endif +#endif // Heap diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index bce66b2e..9d93e3d2 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 544820fd..f9e49aa7 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h -#define LARGE #include "SYSTEM.h" typedef @@ -52,4 +51,4 @@ import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -#endif +#endif // Modules diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 1414fc79..11b9a1a9 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -1913,7 +1917,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != (int64)OPM_LIntSize) { + if (x->typ->size != OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 718d88bb..c3c5c1e8 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h -#define LARGE #include "SYSTEM.h" #include "OPS.h" #include "OPT.h" @@ -47,4 +46,4 @@ import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); -#endif +#endif // OPB diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index fad896b9..e971762c 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -835,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_PointerSize)); OPC_EndStat(); } @@ -918,12 +922,20 @@ static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *cur if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (int64)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", 8); - } else if (align == (int64)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", 8); - } else if (align == (int64)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", 9); + switch (align) { + case 2: + OPM_WriteString((CHAR*)"int16", 6); + break; + case 4: + OPM_WriteString((CHAR*)"int32", 6); + break; + case 8: + OPM_WriteString((CHAR*)"int64", 6); + break; + default: + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Unexpected enclosing alignment in FillGap.", 43); + break; } OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; @@ -1211,7 +1223,8 @@ void OPC_GenHdr (OPT_Node n) OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", 7); + OPM_WriteString((CHAR*)"#endif // ", 11); + OPM_WriteStringVar((void*)OPM_modName, 32); OPM_WriteLn(); } @@ -1298,10 +1311,6 @@ void OPC_GenHdrIncludes (void) OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); @@ -1311,10 +1320,17 @@ void OPC_GenBdy (OPT_Node n) { OPM_currFile = 1; OPC_GenHeaderMsg(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); + OPM_WriteLn(); + OPM_WriteLn(); OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index ac5c7677..a218490a 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h -#define LARGE #include "SYSTEM.h" #include "OPT.h" @@ -49,4 +48,4 @@ import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); -#endif +#endif // OPC diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index f410e6d3..389fda93 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index cc77f079..51042a0e 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h -#define LARGE #include "SYSTEM.h" @@ -63,4 +62,4 @@ import void OPM_err (int32 n); import void *OPM__init(void); -#endif +#endif // OPM diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 6c3c14fe..9ab86b22 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 9aba4ad7..ce85af11 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h -#define LARGE #include "SYSTEM.h" #include "OPT.h" @@ -14,4 +13,4 @@ import void OPP_Module (OPT_Node *prog, SET opt); import void *OPP__init(void); -#endif +#endif // OPP diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index e0988fb0..8e53d027 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 1601514e..ffbc5084 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h -#define LARGE #include "SYSTEM.h" typedef @@ -26,4 +25,4 @@ import void OPS_Init (void); import void *OPS__init(void); -#endif +#endif // OPS diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index c08c86af..bd27c789 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index f50911dd..583c31ff 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h -#define LARGE #include "SYSTEM.h" #include "OPS.h" @@ -104,4 +103,4 @@ import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); import void *OPT__init(void); -#endif +#endif // OPT diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index b8c77e55..2d81dd31 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -17,7 +21,6 @@ static int32 OPV_stamp; static int64 OPV_recno; static OPV_ExitInfo OPV_exit; static int32 OPV_nofExitLabels; -static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -35,7 +38,6 @@ export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); static void OPV_Len (OPT_Node n, int64 dim); export void OPV_Module (OPT_Node prog); -static int64 OPV_NaturalAlignment (int64 size, int64 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int64 n, int64 size); static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp); @@ -52,24 +54,6 @@ static void OPV_expr (OPT_Node n, int32 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static int64 OPV_NaturalAlignment (int64 size, int64 max) -{ - int64 _o_result; - int64 i; - if (size >= max) { - _o_result = max; - return _o_result; - } else { - i = 1; - while (i < size) { - i += i; - } - _o_result = i; - return _o_result; - } - __RETCHK; -} - void OPV_TypSize (OPT_Struct typ) { int32 f, c; @@ -109,9 +93,6 @@ void OPV_TypSize (OPT_Struct typ) if (offset == 0) { offset = 1; } - if (OPM_RecSize == 0) { - base = OPV_NaturalAlignment(offset, OPC_SizeAlignment(OPM_RecSize)); - } OPC_Align(&offset, base); if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { OPV_recno += 1; @@ -569,7 +550,7 @@ static void OPV_design (OPT_Node n, int32 prec) OPT_Struct typ = NIL; int32 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int32 dims, i, _for__28; + int32 dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -645,9 +626,9 @@ static void OPV_design (OPT_Node n, int32 prec) } x = x->left; } - _for__28 = dims; + _for__27 = dims; i = 1; - while (i <= _for__28) { + while (i <= _for__27) { OPM_Write(')'); i += 1; } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 92c13a0a..b10704dc 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h -#define LARGE #include "SYSTEM.h" #include "OPT.h" @@ -17,4 +16,4 @@ import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); -#endif +#endif // OPV diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 0f3aae72..dda7a46a 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" typedef @@ -775,7 +779,6 @@ static void Platform_DisplayHaltCode (int64 code) void Platform_Halt (int64 code) { - int32 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -792,7 +795,6 @@ void Platform_Halt (int64 code) void Platform_AssertFail (int64 code) { - int32 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 0d17921c..472cf2f1 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,14 +1,13 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h -#define LARGE #include "SYSTEM.h" typedef struct Platform_FileIdentity { - LONGINT _prvt0; + int64 _prvt0; char _prvt1[32]; } Platform_FileIdentity; @@ -83,4 +82,4 @@ import void *Platform__init(void); #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) -#endif +#endif // Platform diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 80ca4829..0b5761ee 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index da0c1f86..dfc56cef 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h -#define LARGE #include "SYSTEM.h" @@ -21,4 +20,4 @@ import LONGREAL Reals_TenL (int32 e); import void *Reals__init(void); -#endif +#endif // Reals diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 8c6c335e..6fc57309 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -1,6 +1,24 @@ #ifndef SYSTEM__h #define SYSTEM__h + + +#ifndef LONGINT + #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #define INTEGER int32 + #define LONGINT int64 + #define SET uint64 + #else + #define INTEGER int16 + #define LONGINT int32 + #define SET uint32 + #endif +#endif + + + + + // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. @@ -22,10 +40,12 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if defined(_WIN64) +#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) + // ILP32 or LLP64 typedef long long int64; typedef unsigned long long uint64; #else + // LP64 typedef long int64; typedef unsigned long uint64; #endif @@ -67,29 +87,10 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; +#define uSET SET -// For 32 bit builds, the size of LONGINT depends on a make option: - -#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int32 INTEGER; - typedef int64 LONGINT; - typedef uint64 SET; - typedef uint64 uSET; -#else - typedef int16 INTEGER; - typedef int32 LONGINT; - typedef uint32 SET; - typedef uint32 uSET; -#endif - - -// Temporary defs while bootstrapping - -#define uLONGINT uint64 - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index f240e3b4..39f247ba 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 88b212f1..2c6a801d 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h -#define LARGE #include "SYSTEM.h" @@ -21,4 +20,4 @@ import void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR import void *Strings__init(void); -#endif +#endif // Strings diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 59d184b4..a78b77bb 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index d779d5d5..7156eb22 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h -#define LARGE #include "SYSTEM.h" #include "Files.h" @@ -31,7 +30,7 @@ typedef typedef struct Texts_RunDesc { - LONGINT _prvt0; + int64 _prvt0; char _prvt1[27]; } Texts_RunDesc; @@ -170,4 +169,4 @@ import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGIN import void *Texts__init(void); -#endif +#endif // Texts diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 7a2484a5..46a95ea9 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 1d7e852f..9c9ed747 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index f917a7b6..bf0e9564 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h -#define LARGE #include "SYSTEM.h" typedef @@ -16,4 +15,4 @@ import errors_string errors_errors[350]; import void *errors__init(void); -#endif +#endif // errors diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index d656f5be..c3dc490a 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 1f0bb8e7..c5d5c772 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h -#define LARGE #include "SYSTEM.h" @@ -14,4 +13,4 @@ import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEA import void *extTools__init(void); -#endif +#endif // extTools diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 22698256..fac0e0ba 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index f6c994fa..c2ebcd84 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h -#define LARGE #include "SYSTEM.h" @@ -35,4 +34,4 @@ import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); -#endif +#endif // vt100 diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 44b11ad9..ee6dc10a 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1034,7 +1034,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.ashfn: (*ASH*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF f = OPT.Int THEN - IF x.typ.size # OPM.LIntSize THEN Convert(x, OPT.linttyp) END + IF x.typ.size # OPT.linttyp.size THEN Convert(x, OPT.linttyp) END ELSE err(111); x^.typ := OPT.linttyp END |OPT.adrfn: (*SYSTEM.ADR*) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 362a72df..c5b16ad0 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -552,7 +552,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF typ^.strobj # NIL THEN OPM.WriteStringVar(typ^.strobj^.name) END ; OPM.Write(DoubleQuote); Str1(', #), {', typ^.size); - nofptrs := 0; PutPtrOffsets(typ, 0, nofptrs); Str1("#}}", -(nofptrs + 1) * OPM.LIntSize); + nofptrs := 0; PutPtrOffsets(typ, 0, nofptrs); Str1("#}}", -(nofptrs + 1) * OPM.PointerSize); EndStat END TDescDecl; @@ -589,6 +589,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) RETURN alignment END SizeAlignment; + PROCEDURE BaseAlignment*(typ: OPT.Struct): LONGINT; VAR alignment: LONGINT; BEGIN @@ -606,16 +607,24 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE FillGap(gap, off, align: LONGINT; VAR n, curAlign: LONGINT); + (* gap: Required gap - already calculated based on alignment requirements + off: Current offset - where gap begins + align: Containing record type alignment + n: Next ordinal to use for private field names + curAlign: Largest alignment of any field so far + *) VAR adr: LONGINT; BEGIN adr := off; Align(adr, align); IF (curAlign < align) & (gap - (adr - off) >= align) THEN (* preserve alignment of the enclosing struct! *) DEC(gap, (adr - off) + align); BegStat; - IF align = OPM.IntSize THEN OPM.WriteString("INTEGER") - ELSIF align = OPM.LIntSize THEN OPM.WriteString("LONGINT") - ELSIF align = OPM.LRealSize THEN OPM.WriteString("LONGREAL") - END ; + CASE align OF + |2: OPM.WriteString("int16") + |4: OPM.WriteString("int32") + |8: OPM.WriteString("int64") + ELSE OPM.LogWLn; OPM.LogWStr("Unexpected enclosing alignment in FillGap.") + END; Str1(" _prvt#", n); INC(n); EndStat; curAlign := align END ; @@ -625,30 +634,44 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE FieldList (typ: OPT.Struct; last: BOOLEAN; VAR off, n, curAlign: LONGINT); VAR fld: OPT.Object; base: OPT.Struct; gap, adr, align, fldAlign: LONGINT; BEGIN - fld := typ.link; align := typ^.align MOD 10000H; + fld := typ.link; + align := typ^.align MOD 10000H; IF typ.BaseTyp # NIL THEN FieldList(typ.BaseTyp, FALSE, off, n, curAlign) ELSE off := 0; n := 0; curAlign := 1 - END ; + END; + (* off: Current offset into record + align: Overall (RECORD) alignment + curAlign: Current alignment - largest alignment of any field so far + n: Next ordinal to use for private field names + *) WHILE (fld # NIL) & (fld.mode = OPT.Fld) DO - IF (OPM.currFile = OPM.HeaderFile) & (fld.vis = OPT.internal) OR - (OPM.currFile = OPM.BodyFile) & (fld.vis = OPT.internal) & (typ^.mno # 0) THEN + IF (OPM.currFile = OPM.HeaderFile) & (fld.vis = OPT.internal) + OR (OPM.currFile = OPM.BodyFile) & (fld.vis = OPT.internal) & (typ^.mno # 0) THEN + (* Skip private fields *) fld := fld.link; - WHILE (fld # NIL) & (fld.mode = OPT.Fld) & (fld.vis = OPT.internal) DO fld := fld.link END ; + WHILE (fld # NIL) & (fld.mode = OPT.Fld) & (fld.vis = OPT.internal) DO fld := fld.link END; ELSE (* mimic OPV.TypSize to detect gaps caused by private fields *) - adr := off; fldAlign := BaseAlignment(fld^.typ); Align(adr, fldAlign); + adr := off; + fldAlign := BaseAlignment(fld^.typ); + Align(adr, fldAlign); gap := fld.adr - adr; - IF fldAlign > curAlign THEN curAlign := fldAlign END ; - IF gap > 0 THEN FillGap(gap, off, align, n, curAlign) END ; + IF fldAlign > curAlign THEN curAlign := fldAlign END; + IF gap > 0 THEN + FillGap(gap, off, align, n, curAlign) + END; BegStat; DeclareBase(fld); OPM.Write(' '); DeclareObj(fld, FALSE); off := fld.adr + fld.typ.size; base := fld.typ; fld := fld.link; - WHILE (fld # NIL) & (fld.mode = OPT.Fld) & (fld.typ = base) & (fld.adr = off) + WHILE (fld # NIL) + & (fld.mode = OPT.Fld) + & (fld.typ = base) + & (fld.adr = off) (* ?? *) & ((OPM.currFile = OPM.BodyFile) OR (fld.vis # OPT.internal) OR (fld.typ.strobj = NIL)) DO OPM.WriteString(", "); DeclareObj(fld, FALSE); off := fld.adr + fld.typ.size; fld := fld.link - END ; + END; EndStat END - END ; + END; IF last THEN adr := typ.size - typ^.sysflag DIV 100H; IF adr = 0 THEN gap := 1 (* avoid empty struct *) ELSE gap := adr - off END ; @@ -807,7 +830,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteStringVar(OPM.modName); OPM.WriteString(BodyNameExt); EndStat; OPM.WriteLn; CProcDefs(OPT.topScope^.right, 1); OPM.WriteLn; - OPM.WriteString("#endif"); OPM.WriteLn + OPM.WriteString("#endif // "); OPM.WriteStringVar(OPM.modName); OPM.WriteLn END GenHdr; PROCEDURE GenHeaderMsg; @@ -848,7 +871,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteString("#ifndef "); OPM.WriteStringVar(OPM.modName); OPM.WriteString(FlagExt); OPM.WriteLn; OPM.WriteString("#define "); OPM.WriteStringVar(OPM.modName); OPM.WriteString(FlagExt); OPM.WriteLn; OPM.WriteLn; - IF OPM.LIntSize = 8 THEN OPM.WriteString("#define LARGE"); OPM.WriteLn END; + Include(BasicIncludeFile); IncludeImports(OPT.topScope^.right, 1); OPM.WriteLn END GenHdrIncludes; @@ -857,7 +880,14 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) BEGIN OPM.currFile := OPM.BodyFile; GenHeaderMsg; - IF OPM.LIntSize = 8 THEN OPM.WriteString("#define LARGE"); OPM.WriteLn END; + OPM.WriteLn; + + (* Define adjustable type sizes *) + OPM.WriteString("#define INTEGER int"); OPM.WriteInt(OPT.inttyp.size*8); OPM.WriteLn; + OPM.WriteString("#define LONGINT int"); OPM.WriteInt(OPT.linttyp.size*8); OPM.WriteLn; + OPM.WriteString("#define SET uint"); OPM.WriteInt(OPT.settyp.size*8); OPM.WriteLn; + OPM.WriteLn; + Include(BasicIncludeFile); IncludeImports(OPT.topScope^.right, 0); OPM.WriteLn; DefAnonRecs(n); @@ -1001,10 +1031,10 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) (* If there will be a result, provide a result variable. *) IF proc^.typ # OPT.notyp THEN BegStat; - Ident(proc^.typ^.strobj); - OPM.WriteString(" _o_result;"); - OPM.WriteLn; - END; + Ident(proc^.typ^.strobj); + OPM.WriteString(" _o_result;"); + OPM.WriteLn; + END; scope := proc^.scope; IdentList(scope^.scope, 0); diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index 10ee8ebb..a7810f0c 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -9,7 +9,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) CONST OptionChar* = "-"; - (* compiler options; don't change the encoding *) + (* compiler option flag bits; don't change the encoding *) inxchk* = 0; (* index check on *) ranchk* = 2; (* range check on *) typchk* = 3; (* type check on *) @@ -49,12 +49,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) MaxStruct* = 255; - (* maximal number of pointer fields in a record: *) - MaxPtr* = MAX(LONGINT); - - (* maximal number of global pointers per module: *) - MaxGPtr* = MAX(LONGINT); - (* maximal number of hidden fields in an exported record: *) MaxHdFld* = 2048; diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 7cc0fe38..61125e5b 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -50,24 +50,12 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 VAR assert, inxchk, mainprog, ansi: BOOLEAN; stamp: INTEGER; (* unique number for nested objects *) - (*recno: INTEGER;*) (* number of anonymous record types *) recno: LONGINT; (* number of anonymous record types *) exit: ExitInfo; (* to check if EXIT is simply a break *) nofExitLabels: INTEGER; - naturalAlignment: BOOLEAN; - PROCEDURE NaturalAlignment(size, max: LONGINT): LONGINT; - VAR i: LONGINT; - BEGIN - IF size >= max THEN RETURN max - ELSE i := 1; - WHILE i < size DO INC(i, i) END ; - RETURN i - END - END NaturalAlignment; - PROCEDURE TypSize*(typ: OPT.Struct); VAR f, c: INTEGER; offset, size, base, fbase, off0: LONGINT; fld: OPT.Object; btyp: OPT.Struct; @@ -87,10 +75,10 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 fld^.adr := offset; INC(offset, size); IF fbase > base THEN base := fbase END ; fld := fld^.link - END ; + END; + (* base is now the largest alignment of any field *) off0 := offset; IF offset = 0 THEN offset := 1 END ; (* 1 byte filler to avoid empty struct *) - IF OPM.RecSize = 0 THEN base := NaturalAlignment(offset, (*OPM.RecAlign*)OPC.SizeAlignment(OPM.RecSize)) END ; OPC.Align(offset, base); IF (typ^.strobj = NIL) & (typ^.align MOD 10000H = 0) THEN INC(recno); INC(base, recno * 10000H) END ; typ^.size := offset; typ^.align := base; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index cbd5b646..6c86de7c 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -499,7 +499,6 @@ BEGIN END DisplayHaltCode; PROCEDURE Halt*(code: LONGINT); -VAR e: ErrorCode; BEGIN HaltCode := code; IF HaltHandler # NIL THEN HaltHandler(code) END; @@ -510,7 +509,6 @@ BEGIN END Halt; PROCEDURE AssertFail*(code: LONGINT); -VAR e: ErrorCode; BEGIN errstring("Assertion failure."); IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod index 9ed6bc8c..a81507d9 100644 --- a/src/system/Platformwindows.Mod +++ b/src/system/Platformwindows.Mod @@ -564,7 +564,6 @@ BEGIN END DisplayHaltCode; PROCEDURE Halt*(code: LONGINT); -VAR e: ErrorCode; BEGIN HaltCode := code; IF HaltHandler # NIL THEN HaltHandler(code) END; @@ -575,7 +574,6 @@ BEGIN END Halt; PROCEDURE AssertFail*(code: LONGINT); -VAR e: ErrorCode; BEGIN errstring("Assertion failure."); IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 8c6c335e..6fc57309 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -1,6 +1,24 @@ #ifndef SYSTEM__h #define SYSTEM__h + + +#ifndef LONGINT + #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #define INTEGER int32 + #define LONGINT int64 + #define SET uint64 + #else + #define INTEGER int16 + #define LONGINT int32 + #define SET uint32 + #endif +#endif + + + + + // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. @@ -22,10 +40,12 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if defined(_WIN64) +#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) + // ILP32 or LLP64 typedef long long int64; typedef unsigned long long uint64; #else + // LP64 typedef long int64; typedef unsigned long uint64; #endif @@ -67,29 +87,10 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; +#define uSET SET -// For 32 bit builds, the size of LONGINT depends on a make option: - -#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int32 INTEGER; - typedef int64 LONGINT; - typedef uint64 SET; - typedef uint64 uSET; -#else - typedef int16 INTEGER; - typedef int32 LONGINT; - typedef uint32 SET; - typedef uint32 uSET; -#endif - - -// Temporary defs while bootstrapping - -#define uLONGINT uint64 - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 767763bc..a74b40e8 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -421,6 +421,12 @@ void writeConfigurationMod() { int main(int argc, char *argv[]) { + // Make sure SYSTEM.h has set up our core data types correctly. + assert(sizeof(int8) == 1, "sizeof(int8) is not 1."); + assert(sizeof(int16) == 2, "sizeof(int16) is not 2."); + assert(sizeof(int32) == 4, "sizeof(int32) is not 4."); + assert(sizeof(int64) == 8, "sizeof(int64) is not 8."); + oname = getenv("ONAME"); if (!oname) oname = macrotostring(O_NAME); if (argc>1) {