Browse Source

* set default set packing to 1 for TP/Delphi mode (mantis #15088)

git-svn-id: trunk@14177 -
Jonas Maebe 15 năm trước cách đây
mục cha
commit
af80b89f55
3 tập tin đã thay đổi với 20 bổ sung2 xóa
  1. 1 0
      .gitattributes
  2. 5 2
      compiler/scanner.pas
  3. 14 0
      tests/webtbs/tw15088.pp

+ 1 - 0
.gitattributes

@@ -10027,6 +10027,7 @@ tests/webtbs/tw14812.pp svneol=native#text/plain
 tests/webtbs/tw1485.pp svneol=native#text/plain
 tests/webtbs/tw1489.pp svneol=native#text/plain
 tests/webtbs/tw1501.pp svneol=native#text/plain
+tests/webtbs/tw15088.pp svneol=native#text/plain
 tests/webtbs/tw1532.pp svneol=native#text/plain
 tests/webtbs/tw1539.pp svneol=native#text/plain
 tests/webtbs/tw1567.pp svneol=native#text/plain

+ 5 - 2
compiler/scanner.pas

@@ -374,10 +374,13 @@ implementation
                  include(init_settings.moduleswitches,cs_support_goto);
              end;
 
-           { Default enum packing for delphi/tp7 }
+           { Default enum and set packing for delphi/tp7 }
            if (m_tp7 in current_settings.modeswitches) or
               (m_delphi in current_settings.modeswitches) then
-             current_settings.packenum:=1
+             begin
+               current_settings.packenum:=1;
+               current_settings.setalloc:=1;
+             end
            else if (m_mac in current_settings.modeswitches) then
              { compatible with Metrowerks Pascal }
              current_settings.packenum:=2

+ 14 - 0
tests/webtbs/tw15088.pp

@@ -0,0 +1,14 @@
+{ %norun }
+{$mode delphi}
+
+type
+  TExceptionMask = (emInvalid, emDenormalized, emZeroDivide,
+    emOverflow, emUnderflow, emPrecision);
+  TExceptionMasks = set of TExceptionMask;
+
+var
+  s: TExceptionMasks;
+begin
+  s:=[];
+  writeln(byte(s));
+end.