* support for {$z+/-} (={$z4/1})

git-svn-id: trunk@6109 -
This commit is contained in:
Jonas Maebe 2007-01-21 22:08:53 +00:00
parent 73ce3c3ad1
commit c9148d67a9
3 changed files with 23 additions and 3 deletions

1
.gitattributes vendored
View File

@ -6196,6 +6196,7 @@ tests/tbs/tb0523.pp svneol=native#text/plain
tests/tbs/tb0524.pp svneol=native#text/x-pascal
tests/tbs/tb0525.pp svneol=native#text/plain
tests/tbs/tb0526.pp -text
tests/tbs/tb0527.pp svneol=native#text/plain
tests/tbs/ub0060.pp svneol=native#text/plain
tests/tbs/ub0069.pp svneol=native#text/plain
tests/tbs/ub0119.pp svneol=native#text/plain

View File

@ -39,7 +39,7 @@ uses
****************************************************************************}
type
TSwitchType=(ignoredsw,localsw,modulesw,globalsw,illegalsw,unsupportedsw,alignsw,optimizersw);
TSwitchType=(ignoredsw,localsw,modulesw,globalsw,illegalsw,unsupportedsw,alignsw,optimizersw,packenumsw);
SwitchRec=record
typesw : TSwitchType;
setsw : byte;
@ -73,7 +73,7 @@ const
{W} (typesw:localsw; setsw:ord(cs_generate_stackframes)),
{X} (typesw:modulesw; setsw:ord(cs_extsyntax)),
{Y} (typesw:unsupportedsw; setsw:ord(cs_localnone)),
{Z} (typesw:illegalsw; setsw:ord(cs_localnone))
{Z} (typesw:packenumsw; setsw:ord(cs_localnone))
);
@ -188,7 +188,14 @@ begin
else
Message(scan_w_switch_is_global);
end;
end;
packenumsw:
begin
if state='-' then
current_settings.packenum:=1
else
current_settings.packenum:=4;
end;
end;
end;
end;
@ -222,6 +229,7 @@ begin
localsw : found:=(tlocalswitch(setsw) in current_settings.localswitches);
modulesw : found:=(tmoduleswitch(setsw) in current_settings.moduleswitches);
globalsw : found:=(tglobalswitch(setsw) in current_settings.globalswitches);
packenumsw : found := (current_settings.packenum = 4);
else
found:=false;
end;

11
tests/tbs/tb0527.pp Normal file
View File

@ -0,0 +1,11 @@
type
{$z-}
te1 = (a,b,c);
{$z+}
te2 = (e,f,g);
begin
if sizeof(te1) <> 1 then
halt(1);
if sizeof(te2) <> 4 then
halt(2);
end.