Explorar el Código

Allow widechar sets, reduce to ansichar set

Michael VAN CANNEYT hace 2 años
padre
commit
e4bd8c974e
Se han modificado 1 ficheros con 11 adiciones y 2 borrados
  1. 11 2
      compiler/ptype.pas

+ 11 - 2
compiler/ptype.pas

@@ -1320,8 +1320,17 @@ implementation
                   Message(sym_e_ill_type_decl_set);
                orddef :
                  begin
-                   if (torddef(tt2).ordtype<>uvoid) and
-                      (torddef(tt2).ordtype<>uwidechar) and
+                   if (torddef(tt2).ordtype=uwidechar) then
+                     begin
+                     if (m_default_unicodestring in current_settings.modeswitches) then
+                       begin
+                       Message(parser_w_widechar_set_reduced);
+                       def:=csetdef.create(cansichartype,torddef(cansichartype).low.svalue,torddef(cansichartype).high.svalue,true);
+                       end
+                     else
+                       Message(sym_e_ill_type_decl_set);  
+                     end
+                   else if (torddef(tt2).ordtype<>uvoid) and
                       (torddef(tt2).low>=0) then
                      // !! def:=csetdef.create(tt2,torddef(tt2.def).low,torddef(tt2.def).high),true)
                      if Torddef(tt2).high>int64(high(byte)) then