mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 04:02:25 +00:00
- src/compiler/OPT.Mod: Introduced two new constants in the pseudo-module
SYSTEM: MAXPATHLEN and 'MAXFILENAMELEN. Both represent the maximum
lengths of pathnames and (single) filenames of the underlying operating
system for which the compiler will actually be generated. This is done
by importing the system dependent constants from the automatically
created module 'Configuration.Mod' which is hereby *imported* into
'OPT.Mod' ...
- src/tools/make/configure.c: Added '#include <limits.h>' (introducing
PATH_MAX and NAME_MAX into this program. Extended the code for the
module 'Configuration.Mod' by two constant definitions: 'MaxPathLen'
(holding the value if PATH_MAX) and 'MaxFnLen' (=> NAME_MAX). This
allows for an automatical configuration of MAXPATHLEN and MAXFILENAMELEN
in 'src/compiler/OPT.Mod' ...
This commit is contained in:
parent
4bbacbaaa4
commit
1d6e2ef187
2 changed files with 16 additions and 3 deletions
|
|
@ -4,7 +4,7 @@ MODULE OPT; (* NW, RC 6.3.89 / 23.1.92 *) (* object model 24.2.94 *)
|
||||||
2002-08-20 jt: NewStr: txtpos remains 0 for structs read from symbol file
|
2002-08-20 jt: NewStr: txtpos remains 0 for structs read from symbol file
|
||||||
*)
|
*)
|
||||||
|
|
||||||
IMPORT OPS, OPM, SYSTEM;
|
IMPORT OPS, OPM, SYSTEM, Configuration;
|
||||||
|
|
||||||
|
|
||||||
(* Constants - value of literals *)
|
(* Constants - value of literals *)
|
||||||
|
|
@ -1310,6 +1310,13 @@ END Import;
|
||||||
obj^.mode := Con; obj^.typ := booltyp; obj^.conval^.intval := value
|
obj^.mode := Con; obj^.typ := booltyp; obj^.conval^.intval := value
|
||||||
END EnterBoolConst;
|
END EnterBoolConst;
|
||||||
|
|
||||||
|
PROCEDURE EnterIntConst(name: OPS.Name; value: LONGINT);
|
||||||
|
VAR obj: Object;
|
||||||
|
BEGIN
|
||||||
|
Insert(name, obj); obj^.conval := NewConst();
|
||||||
|
obj^.mode := Con; obj^.typ := int32typ; obj^.conval^.intval := value;
|
||||||
|
END EntarIntConst;
|
||||||
|
|
||||||
PROCEDURE EnterTyp(name: OPS.Name; form: SHORTINT; size: INTEGER; VAR res: Struct);
|
PROCEDURE EnterTyp(name: OPS.Name; form: SHORTINT; size: INTEGER; VAR res: Struct);
|
||||||
VAR obj: Object; typ: Struct;
|
VAR obj: Object; typ: Struct;
|
||||||
BEGIN
|
BEGIN
|
||||||
|
|
@ -1367,6 +1374,9 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0;
|
||||||
EnterProc("NEW", sysnewfn);
|
EnterProc("NEW", sysnewfn);
|
||||||
EnterProc("MOVE", movefn);
|
EnterProc("MOVE", movefn);
|
||||||
|
|
||||||
|
(* POSIX systems normally support PATH_MAX *)
|
||||||
|
EnterIntConst("MAXPATHLEN", Configuration.MaxPathLen);
|
||||||
|
EnterIntConst("MAXFILENAMELENGTH", Configuration.MaxFnLen);
|
||||||
|
|
||||||
syslink := topScope^.right;
|
syslink := topScope^.right;
|
||||||
universe := topScope; topScope^.right := NIL;
|
universe := topScope; topScope^.right := NIL;
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <limits.h> // for enabling PATH_MAX ...
|
||||||
|
|
||||||
|
|
||||||
void fail(char *msg) {fprintf(stderr, "Error: %s\n", msg); exit(1);}
|
void fail(char *msg) {fprintf(stderr, "Error: %s\n", msg); exit(1);}
|
||||||
|
|
@ -42,8 +43,8 @@ char builddate[256];
|
||||||
char installdir[256];
|
char installdir[256];
|
||||||
char versionstring[256];
|
char versionstring[256];
|
||||||
char osrelease[1024];
|
char osrelease[1024];
|
||||||
char cwd[1024];
|
char cwd[PATH_MAX];
|
||||||
char libspec[1024];
|
char libspec[PATH_MAX*8];
|
||||||
|
|
||||||
#define macrotostringhelper(s) #s
|
#define macrotostringhelper(s) #s
|
||||||
#define macrotostring(s) macrotostringhelper(s)
|
#define macrotostring(s) macrotostringhelper(s)
|
||||||
|
|
@ -401,6 +402,8 @@ void writeConfigurationMod() {
|
||||||
fprintf(fd, " compile* = '%s';\n", cc);
|
fprintf(fd, " compile* = '%s';\n", cc);
|
||||||
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, " MaxPathLen* = %d;\n", PATH_MAX);
|
||||||
|
fprintf(fd " MaxFnLen* = %d;\n", NAME_MAX);
|
||||||
fprintf(fd, "VAR\n");
|
fprintf(fd, "VAR\n");
|
||||||
fprintf(fd, " versionLong-: ARRAY %d OF CHAR;\n", (int)strnlen(versionstring, 100)+1);
|
fprintf(fd, " versionLong-: ARRAY %d OF CHAR;\n", (int)strnlen(versionstring, 100)+1);
|
||||||
fprintf(fd, "BEGIN\n");
|
fprintf(fd, "BEGIN\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue