Beginning to simplify build process

This commit is contained in:
David Brown 2016-09-23 17:12:02 +01:00
parent 22a4f8e263
commit 8017aa445c
13 changed files with 56 additions and 57 deletions

View file

@ -19,7 +19,7 @@ typedef
static CHAR OPM_SourceFileName[256]; static CHAR OPM_SourceFileName[256];
export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet;
export int64 OPM_MaxIndex; export int64 OPM_MaxIndex;
export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
export BOOLEAN OPM_noerr; export BOOLEAN OPM_noerr;
@ -28,8 +28,7 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
export CHAR OPM_modName[32]; export CHAR OPM_modName[32];
export CHAR OPM_objname[64]; export CHAR OPM_objname[64];
export SET OPM_opt, OPM_glbopt; export SET OPM_opt, OPM_glbopt;
static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos;
static int64 OPM_lasterrpos;
static Texts_Reader OPM_inR; static Texts_Reader OPM_inR;
static Texts_Text OPM_Log; static Texts_Text OPM_Log;
static Texts_Writer OPM_W; static Texts_Writer OPM_W;
@ -63,7 +62,7 @@ export void OPM_LogWNum (int64 i, int64 len);
export void OPM_LogWStr (CHAR *s, LONGINT s__len); export void OPM_LogWStr (CHAR *s, LONGINT s__len);
export int32 OPM_Longint (int64 n); export int32 OPM_Longint (int64 n);
static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len);
export void OPM_Mark (int16 n, int64 pos); export void OPM_Mark (int16 n, int32 pos);
export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_NewSym (CHAR *modName, LONGINT modName__len);
export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done);
export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len);
@ -97,6 +96,7 @@ export void OPM_err (int16 n);
static int32 OPM_minusop (int32 i); static int32 OPM_minusop (int32 i);
static int32 OPM_power0 (int32 i, int32 j); static int32 OPM_power0 (int32 i, int32 j);
#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s
void OPM_LogW (CHAR ch) void OPM_LogW (CHAR ch)
{ {
@ -570,7 +570,7 @@ static void OPM_ShowLine (int64 pos)
Files_Close(f); Files_Close(f);
} }
void OPM_Mark (int16 n, int64 pos) void OPM_Mark (int16 n, int32 pos)
{ {
if (pos == -1) { if (pos == -1) {
pos = 0; pos = 0;
@ -1121,8 +1121,8 @@ export void *OPM__init(void)
Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024);
Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024);
Files_SetSearchPath(OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024);
OPM_AddressSize = 8; OPM_AddressSize = 4;
OPM_Alignment = 8; OPM_GetAlignment(&OPM_Alignment);
OPM_ShortintSize = 1; OPM_ShortintSize = 1;
OPM_IntegerSize = 2; OPM_IntegerSize = 2;
OPM_LongintSize = 4; OPM_LongintSize = 4;

View file

@ -6,7 +6,7 @@
#include "SYSTEM.h" #include "SYSTEM.h"
import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet;
import int64 OPM_MaxIndex; import int64 OPM_MaxIndex;
import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
import BOOLEAN OPM_noerr; import BOOLEAN OPM_noerr;
@ -33,7 +33,7 @@ import void OPM_LogWLn (void);
import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWNum (int64 i, int64 len);
import void OPM_LogWStr (CHAR *s, LONGINT s__len); import void OPM_LogWStr (CHAR *s, LONGINT s__len);
import int32 OPM_Longint (int64 n); import int32 OPM_Longint (int64 n);
import void OPM_Mark (int16 n, int64 pos); import void OPM_Mark (int16 n, int32 pos);
import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_NewSym (CHAR *modName, LONGINT modName__len);
import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done);
import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len);

View file

@ -19,7 +19,7 @@ typedef
static CHAR OPM_SourceFileName[256]; static CHAR OPM_SourceFileName[256];
export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet;
export int64 OPM_MaxIndex; export int64 OPM_MaxIndex;
export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
export BOOLEAN OPM_noerr; export BOOLEAN OPM_noerr;
@ -28,8 +28,7 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
export CHAR OPM_modName[32]; export CHAR OPM_modName[32];
export CHAR OPM_objname[64]; export CHAR OPM_objname[64];
export SET OPM_opt, OPM_glbopt; export SET OPM_opt, OPM_glbopt;
static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos;
static int64 OPM_lasterrpos;
static Texts_Reader OPM_inR; static Texts_Reader OPM_inR;
static Texts_Text OPM_Log; static Texts_Text OPM_Log;
static Texts_Writer OPM_W; static Texts_Writer OPM_W;
@ -63,7 +62,7 @@ export void OPM_LogWNum (int64 i, int64 len);
export void OPM_LogWStr (CHAR *s, LONGINT s__len); export void OPM_LogWStr (CHAR *s, LONGINT s__len);
export int32 OPM_Longint (int64 n); export int32 OPM_Longint (int64 n);
static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len);
export void OPM_Mark (int16 n, int64 pos); export void OPM_Mark (int16 n, int32 pos);
export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_NewSym (CHAR *modName, LONGINT modName__len);
export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done);
export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len);
@ -97,6 +96,7 @@ export void OPM_err (int16 n);
static int32 OPM_minusop (int32 i); static int32 OPM_minusop (int32 i);
static int32 OPM_power0 (int32 i, int32 j); static int32 OPM_power0 (int32 i, int32 j);
#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s
void OPM_LogW (CHAR ch) void OPM_LogW (CHAR ch)
{ {
@ -570,7 +570,7 @@ static void OPM_ShowLine (int64 pos)
Files_Close(f); Files_Close(f);
} }
void OPM_Mark (int16 n, int64 pos) void OPM_Mark (int16 n, int32 pos)
{ {
if (pos == -1) { if (pos == -1) {
pos = 0; pos = 0;
@ -1121,8 +1121,8 @@ export void *OPM__init(void)
Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024);
Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024);
Files_SetSearchPath(OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024);
OPM_AddressSize = 8; OPM_AddressSize = 4;
OPM_Alignment = 8; OPM_GetAlignment(&OPM_Alignment);
OPM_ShortintSize = 1; OPM_ShortintSize = 1;
OPM_IntegerSize = 2; OPM_IntegerSize = 2;
OPM_LongintSize = 4; OPM_LongintSize = 4;

View file

@ -6,7 +6,7 @@
#include "SYSTEM.h" #include "SYSTEM.h"
import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet;
import int64 OPM_MaxIndex; import int64 OPM_MaxIndex;
import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
import BOOLEAN OPM_noerr; import BOOLEAN OPM_noerr;
@ -33,7 +33,7 @@ import void OPM_LogWLn (void);
import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWNum (int64 i, int64 len);
import void OPM_LogWStr (CHAR *s, LONGINT s__len); import void OPM_LogWStr (CHAR *s, LONGINT s__len);
import int32 OPM_Longint (int64 n); import int32 OPM_Longint (int64 n);
import void OPM_Mark (int16 n, int64 pos); import void OPM_Mark (int16 n, int32 pos);
import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_NewSym (CHAR *modName, LONGINT modName__len);
import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done);
import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len);

View file

@ -19,7 +19,7 @@ typedef
static CHAR OPM_SourceFileName[256]; static CHAR OPM_SourceFileName[256];
export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet;
export int64 OPM_MaxIndex; export int64 OPM_MaxIndex;
export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
export BOOLEAN OPM_noerr; export BOOLEAN OPM_noerr;
@ -28,8 +28,7 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
export CHAR OPM_modName[32]; export CHAR OPM_modName[32];
export CHAR OPM_objname[64]; export CHAR OPM_objname[64];
export SET OPM_opt, OPM_glbopt; export SET OPM_opt, OPM_glbopt;
static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos;
static int64 OPM_lasterrpos;
static Texts_Reader OPM_inR; static Texts_Reader OPM_inR;
static Texts_Text OPM_Log; static Texts_Text OPM_Log;
static Texts_Writer OPM_W; static Texts_Writer OPM_W;
@ -63,7 +62,7 @@ export void OPM_LogWNum (int64 i, int64 len);
export void OPM_LogWStr (CHAR *s, LONGINT s__len); export void OPM_LogWStr (CHAR *s, LONGINT s__len);
export int32 OPM_Longint (int64 n); export int32 OPM_Longint (int64 n);
static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len);
export void OPM_Mark (int16 n, int64 pos); export void OPM_Mark (int16 n, int32 pos);
export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_NewSym (CHAR *modName, LONGINT modName__len);
export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done);
export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len);
@ -97,6 +96,7 @@ export void OPM_err (int16 n);
static int32 OPM_minusop (int32 i); static int32 OPM_minusop (int32 i);
static int32 OPM_power0 (int32 i, int32 j); static int32 OPM_power0 (int32 i, int32 j);
#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s
void OPM_LogW (CHAR ch) void OPM_LogW (CHAR ch)
{ {
@ -570,7 +570,7 @@ static void OPM_ShowLine (int64 pos)
Files_Close(f); Files_Close(f);
} }
void OPM_Mark (int16 n, int64 pos) void OPM_Mark (int16 n, int32 pos)
{ {
if (pos == -1) { if (pos == -1) {
pos = 0; pos = 0;
@ -1122,7 +1122,7 @@ export void *OPM__init(void)
Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024);
Files_SetSearchPath(OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024);
OPM_AddressSize = 8; OPM_AddressSize = 8;
OPM_Alignment = 8; OPM_GetAlignment(&OPM_Alignment);
OPM_ShortintSize = 1; OPM_ShortintSize = 1;
OPM_IntegerSize = 2; OPM_IntegerSize = 2;
OPM_LongintSize = 4; OPM_LongintSize = 4;

View file

@ -6,7 +6,7 @@
#include "SYSTEM.h" #include "SYSTEM.h"
import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet;
import int64 OPM_MaxIndex; import int64 OPM_MaxIndex;
import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
import BOOLEAN OPM_noerr; import BOOLEAN OPM_noerr;
@ -33,7 +33,7 @@ import void OPM_LogWLn (void);
import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWNum (int64 i, int64 len);
import void OPM_LogWStr (CHAR *s, LONGINT s__len); import void OPM_LogWStr (CHAR *s, LONGINT s__len);
import int32 OPM_Longint (int64 n); import int32 OPM_Longint (int64 n);
import void OPM_Mark (int16 n, int64 pos); import void OPM_Mark (int16 n, int32 pos);
import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_NewSym (CHAR *modName, LONGINT modName__len);
import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done);
import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len);

View file

@ -19,7 +19,7 @@ typedef
static CHAR OPM_SourceFileName[256]; static CHAR OPM_SourceFileName[256];
export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet;
export int64 OPM_MaxIndex; export int64 OPM_MaxIndex;
export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
export BOOLEAN OPM_noerr; export BOOLEAN OPM_noerr;
@ -28,8 +28,7 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
export CHAR OPM_modName[32]; export CHAR OPM_modName[32];
export CHAR OPM_objname[64]; export CHAR OPM_objname[64];
export SET OPM_opt, OPM_glbopt; export SET OPM_opt, OPM_glbopt;
static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos;
static int64 OPM_lasterrpos;
static Texts_Reader OPM_inR; static Texts_Reader OPM_inR;
static Texts_Text OPM_Log; static Texts_Text OPM_Log;
static Texts_Writer OPM_W; static Texts_Writer OPM_W;
@ -63,7 +62,7 @@ export void OPM_LogWNum (int64 i, int64 len);
export void OPM_LogWStr (CHAR *s, LONGINT s__len); export void OPM_LogWStr (CHAR *s, LONGINT s__len);
export int32 OPM_Longint (int64 n); export int32 OPM_Longint (int64 n);
static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len);
export void OPM_Mark (int16 n, int64 pos); export void OPM_Mark (int16 n, int32 pos);
export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_NewSym (CHAR *modName, LONGINT modName__len);
export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done);
export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len);
@ -97,6 +96,7 @@ export void OPM_err (int16 n);
static int32 OPM_minusop (int32 i); static int32 OPM_minusop (int32 i);
static int32 OPM_power0 (int32 i, int32 j); static int32 OPM_power0 (int32 i, int32 j);
#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s
void OPM_LogW (CHAR ch) void OPM_LogW (CHAR ch)
{ {
@ -570,7 +570,7 @@ static void OPM_ShowLine (int64 pos)
Files_Close(f); Files_Close(f);
} }
void OPM_Mark (int16 n, int64 pos) void OPM_Mark (int16 n, int32 pos)
{ {
if (pos == -1) { if (pos == -1) {
pos = 0; pos = 0;
@ -1121,8 +1121,8 @@ export void *OPM__init(void)
Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024);
Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024);
Files_SetSearchPath(OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024);
OPM_AddressSize = 8; OPM_AddressSize = 4;
OPM_Alignment = 8; OPM_GetAlignment(&OPM_Alignment);
OPM_ShortintSize = 1; OPM_ShortintSize = 1;
OPM_IntegerSize = 2; OPM_IntegerSize = 2;
OPM_LongintSize = 4; OPM_LongintSize = 4;

View file

@ -6,7 +6,7 @@
#include "SYSTEM.h" #include "SYSTEM.h"
import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet;
import int64 OPM_MaxIndex; import int64 OPM_MaxIndex;
import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
import BOOLEAN OPM_noerr; import BOOLEAN OPM_noerr;
@ -33,7 +33,7 @@ import void OPM_LogWLn (void);
import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWNum (int64 i, int64 len);
import void OPM_LogWStr (CHAR *s, LONGINT s__len); import void OPM_LogWStr (CHAR *s, LONGINT s__len);
import int32 OPM_Longint (int64 n); import int32 OPM_Longint (int64 n);
import void OPM_Mark (int16 n, int64 pos); import void OPM_Mark (int16 n, int32 pos);
import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_NewSym (CHAR *modName, LONGINT modName__len);
import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done);
import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len);

View file

@ -19,7 +19,7 @@ typedef
static CHAR OPM_SourceFileName[256]; static CHAR OPM_SourceFileName[256];
export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet;
export int64 OPM_MaxIndex; export int64 OPM_MaxIndex;
export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
export BOOLEAN OPM_noerr; export BOOLEAN OPM_noerr;
@ -28,8 +28,7 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
export CHAR OPM_modName[32]; export CHAR OPM_modName[32];
export CHAR OPM_objname[64]; export CHAR OPM_objname[64];
export SET OPM_opt, OPM_glbopt; export SET OPM_opt, OPM_glbopt;
static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos;
static int64 OPM_lasterrpos;
static Texts_Reader OPM_inR; static Texts_Reader OPM_inR;
static Texts_Text OPM_Log; static Texts_Text OPM_Log;
static Texts_Writer OPM_W; static Texts_Writer OPM_W;
@ -63,7 +62,7 @@ export void OPM_LogWNum (int64 i, int64 len);
export void OPM_LogWStr (CHAR *s, LONGINT s__len); export void OPM_LogWStr (CHAR *s, LONGINT s__len);
export int32 OPM_Longint (int64 n); export int32 OPM_Longint (int64 n);
static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len);
export void OPM_Mark (int16 n, int64 pos); export void OPM_Mark (int16 n, int32 pos);
export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_NewSym (CHAR *modName, LONGINT modName__len);
export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done);
export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len);
@ -97,6 +96,7 @@ export void OPM_err (int16 n);
static int32 OPM_minusop (int32 i); static int32 OPM_minusop (int32 i);
static int32 OPM_power0 (int32 i, int32 j); static int32 OPM_power0 (int32 i, int32 j);
#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s
void OPM_LogW (CHAR ch) void OPM_LogW (CHAR ch)
{ {
@ -570,7 +570,7 @@ static void OPM_ShowLine (int64 pos)
Files_Close(f); Files_Close(f);
} }
void OPM_Mark (int16 n, int64 pos) void OPM_Mark (int16 n, int32 pos)
{ {
if (pos == -1) { if (pos == -1) {
pos = 0; pos = 0;
@ -1122,7 +1122,7 @@ export void *OPM__init(void)
Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024);
Files_SetSearchPath(OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024);
OPM_AddressSize = 8; OPM_AddressSize = 8;
OPM_Alignment = 8; OPM_GetAlignment(&OPM_Alignment);
OPM_ShortintSize = 1; OPM_ShortintSize = 1;
OPM_IntegerSize = 2; OPM_IntegerSize = 2;
OPM_LongintSize = 4; OPM_LongintSize = 4;

View file

@ -6,7 +6,7 @@
#include "SYSTEM.h" #include "SYSTEM.h"
import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet;
import int64 OPM_MaxIndex; import int64 OPM_MaxIndex;
import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
import BOOLEAN OPM_noerr; import BOOLEAN OPM_noerr;
@ -33,7 +33,7 @@ import void OPM_LogWLn (void);
import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWNum (int64 i, int64 len);
import void OPM_LogWStr (CHAR *s, LONGINT s__len); import void OPM_LogWStr (CHAR *s, LONGINT s__len);
import int32 OPM_Longint (int64 n); import int32 OPM_Longint (int64 n);
import void OPM_Mark (int16 n, int64 pos); import void OPM_Mark (int16 n, int32 pos);
import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_NewSym (CHAR *modName, LONGINT modName__len);
import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done);
import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len);

View file

@ -67,7 +67,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
BodyFile* = 1; BodyFile* = 1;
HeaderInclude* = 2; HeaderInclude* = 2;
(* C default expression integral size details. Const for now, will be var with avr_gcc/sdcc support *) (* C default expression integral size details. Const for now, should be var for avr_gcc/sdcc support *)
CIntSize* = 4; CIntSize* = 4;
CIntMax* = 7FFFFFFFH; CIntMax* = 7FFFFFFFH;
CIntMin* = -CIntMax - 1; CIntMin* = -CIntMax - 1;
@ -88,12 +88,11 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
SourceFileName : ARRAY 256 OF CHAR; SourceFileName : ARRAY 256 OF CHAR;
(* Parameter selectable sizes *) (* Parameter selectable sizes *)
Alignment*, AddressSize*, Alignment*,
AddressSize*, SetSize*, SetSize*,
ShortintSize*, IntegerSize*, LongintSize*: INTEGER; ShortintSize*, IntegerSize*, LongintSize*: INTEGER;
MaxSet*: INTEGER; MaxSet*: INTEGER;
MaxIndex*: SYSTEM.INT64; MaxIndex*: SYSTEM.INT64;
MinReal*, MaxReal*, MinLReal*, MaxLReal*: LONGREAL; MinReal*, MaxReal*, MinLReal*, MaxLReal*: LONGREAL;
@ -110,7 +109,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
ErrorLineStartPos, ErrorLineLimitPos, ErrorLineNumber: LONGINT; (* Limit = start of next line *) ErrorLineStartPos, ErrorLineLimitPos, ErrorLineNumber: LONGINT; (* Limit = start of next line *)
lasterrpos: SYSTEM.INT64; lasterrpos: LONGINT;
inR: Texts.Reader; inR: Texts.Reader;
Log: Texts.Text; Log: Texts.Text;
W: Texts.Writer; W: Texts.Writer;
@ -479,7 +478,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
END ShowLine; END ShowLine;
PROCEDURE Mark*(n: INTEGER; pos: SYSTEM.INT64); PROCEDURE Mark*(n: INTEGER; pos: LONGINT);
BEGIN BEGIN
IF pos = -1 THEN pos := 0 END; IF pos = -1 THEN pos := 0 END;
IF n >= 0 THEN IF n >= 0 THEN
@ -853,6 +852,10 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
END CloseFiles; END CloseFiles;
PROCEDURE -GetAlignment(VAR a: INTEGER) "struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s";
BEGIN BEGIN
Texts.OpenWriter(W); Texts.OpenWriter(W);
@ -867,9 +870,9 @@ BEGIN
Files.SetSearchPath(OBERON); Files.SetSearchPath(OBERON);
(* type sizes with configuration based defaults *) (* Default address size and alignment are those of this compiler *)
AddressSize := Configuration.addressSize; AddressSize := SIZE(SYSTEM.ADDRESS);
Alignment := Configuration.alignment; GetAlignment(Alignment);
(* Default type size model is that of the original Oberon-2 implementation (-O2) *) (* Default type size model is that of the original Oberon-2 implementation (-O2) *)
ShortintSize := 1; ShortintSize := 1;

View file

@ -96,7 +96,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *)
extTools.Assemble(OPM.modName) extTools.Assemble(OPM.modName)
ELSE ELSE
IF ~(OPM.mainprog IN OPM.opt) THEN IF ~(OPM.mainprog IN OPM.opt) THEN
(* Assemble non main rogram and add object name to link list *) (* Assemble non main program and add object name to link list *)
extTools.Assemble(OPM.modName); extTools.Assemble(OPM.modName);
Strings.Append(" ", modulesobj); Strings.Append(" ", modulesobj);
Strings.Append(OPM.modName, modulesobj); Strings.Append(OPM.modName, modulesobj);

View file

@ -401,15 +401,11 @@ void writeConfigurationMod() {
fprintf(fd, "MODULE Configuration;\n"); fprintf(fd, "MODULE Configuration;\n");
fprintf(fd, "CONST\n"); fprintf(fd, "CONST\n");
fprintf(fd, " name* = '%s';\n", oname); fprintf(fd, " name* = '%s';\n", oname);
fprintf(fd, " intsize* = %d;\n", intsize);
fprintf(fd, " addressSize* = %d;\n", addressSize);
fprintf(fd, " alignment* = %d;\n", alignment);
fprintf(fd, " objext* = '%s';\n", objext); fprintf(fd, " objext* = '%s';\n", objext);
fprintf(fd, " objflag* = '%s';\n", objflag); fprintf(fd, " objflag* = '%s';\n", objflag);
fprintf(fd, " linkflags* = '%s';\n", linkflags); fprintf(fd, " linkflags* = '%s';\n", linkflags);
fprintf(fd, " libspec* = '%s';\n", libspec); fprintf(fd, " libspec* = '%s';\n", libspec);
fprintf(fd, " compile* = '%s';\n", cc); fprintf(fd, " compile* = '%s';\n", cc);
fprintf(fd, " dataModel* = '%s';\n", dataModel);
fprintf(fd, " installdir* = '%s';\n", installdir); fprintf(fd, " installdir* = '%s';\n", installdir);
fprintf(fd, " staticLink* = '%s';\n", staticlink); fprintf(fd, " staticLink* = '%s';\n", staticlink);
fprintf(fd, "VAR\n"); fprintf(fd, "VAR\n");