Browse Source

+ some stuff to compile FreeCLX added

florian 24 years ago
parent
commit
e964449b71
4 changed files with 46 additions and 9 deletions
  1. 7 2
      compiler/ninl.pas
  2. 7 5
      compiler/nmem.pas
  3. 5 1
      compiler/options.pas
  4. 27 1
      compiler/types.pas

+ 7 - 2
compiler/ninl.pas

@@ -588,7 +588,9 @@ implementation
              in_length_string:
                begin
                   set_varstate(left,true);
-                  if is_ansistring(left.resulttype) then
+                  if is_ansistring(left.resulttype) or
+                    is_widestring(left.resulttype) or
+                    is_dynamic_array(left.resulttype) then
                     resulttype:=s32bitdef
                   else
                     resulttype:=u8bitdef;
@@ -1537,7 +1539,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.30  2001-03-12 12:47:46  michael
+  Revision 1.31  2001-03-23 00:16:07  florian
+    + some stuff to compile FreeCLX added
+
+  Revision 1.30  2001/03/12 12:47:46  michael
   + Patches from peter
 
   Revision 1.29  2001/03/03 12:38:08  jonas

+ 7 - 5
compiler/nmem.pas

@@ -674,7 +674,8 @@ implementation
            delphi/tp7 it's only allowed for pchars }
          if (left.resulttype^.deftype=pointerdef) and
             ((m_fpc in aktmodeswitches) or
-             is_pchar(left.resulttype)) then
+             is_pchar(left.resulttype) or
+             is_pwidechar(left.resulttype)) then
           begin
             { convert pointer to array }
             harr:=new(parraydef,init(0,$7fffffff,s32bitdef));
@@ -694,9 +695,7 @@ implementation
              begin
                 { indexed access to strings }
                 case pstringdef(left.resulttype)^.string_typ of
-                   {
-                   st_widestring : resulttype:=cwchardef;
-                   }
+                   st_widestring : resulttype:=cwidechardef;
                    st_ansistring : resulttype:=cchardef;
                    st_longstring : resulttype:=cchardef;
                    st_shortstring : resulttype:=cchardef;
@@ -902,7 +901,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.14  2000-12-31 11:14:11  jonas
+  Revision 1.15  2001-03-23 00:16:07  florian
+    + some stuff to compile FreeCLX added
+
+  Revision 1.14  2000/12/31 11:14:11  jonas
     + implemented/fixed docompare() mathods for all nodes (not tested)
     + nopt.pas, nadd.pas, i386/n386opt.pas: optimized nodes for adding strings
       and constant strings/chars together

+ 5 - 1
compiler/options.pas

@@ -1274,6 +1274,7 @@ begin
   def_symbol('HASWIDECHAR');
   def_symbol('HASOUT');
   def_symbol('HASINTF');
+  def_symbol('HASVARIANT');
   def_symbol('INTERNSETLENGTH');
   def_symbol('INT64FUNCRESOK');
   def_symbol('PACKENUMFIXED');
@@ -1554,7 +1555,10 @@ finalization
 end.
 {
   $Log$
-  Revision 1.36  2001-03-13 20:59:56  peter
+  Revision 1.37  2001-03-23 00:16:07  florian
+    + some stuff to compile FreeCLX added
+
+  Revision 1.36  2001/03/13 20:59:56  peter
     * message loading fixes from Sergey (merged)
 
   Revision 1.35  2001/03/10 13:19:10  peter

+ 27 - 1
compiler/types.pas

@@ -98,6 +98,9 @@ interface
     { true if p is a char array def }
     function is_chararray(p : pdef) : boolean;
 
+    { true if p is a wide char array def }
+    function is_widechararray(p : pdef) : boolean;
+
 {*****************************************************************************
                           String helper functions
  *****************************************************************************}
@@ -120,6 +123,9 @@ interface
     { true if p is a pchar def }
     function is_pchar(p : pdef) : boolean;
 
+    { true if p is a pwidechar def }
+    function is_pwidechar(p : pdef) : boolean;
+
     { true if p is a voidpointer def }
     function is_voidpointer(p : pdef) : boolean;
 
@@ -669,6 +675,14 @@ implementation
                       not(is_special_array(p));
       end;
 
+    { true if p is a widechar array def }
+    function is_widechararray(p : pdef) : boolean;
+      begin
+        is_widechararray:=(p^.deftype=arraydef) and
+                      is_equal(parraydef(p)^.elementtype.def,cwidechardef) and
+                      not(is_special_array(p));
+      end;
+
 
     { true if p is a pchar def }
     function is_pchar(p : pdef) : boolean;
@@ -679,6 +693,15 @@ implementation
                     is_chararray(ppointerdef(p)^.pointertype.def)));
       end;
 
+    { true if p is a pchar def }
+    function is_pwidechar(p : pdef) : boolean;
+      begin
+        is_pwidechar:=(p^.deftype=pointerdef) and
+                  (is_equal(ppointerdef(p)^.pointertype.def,cwidechardef) or
+                   (is_zero_based_array(ppointerdef(p)^.pointertype.def) and
+                    is_widechararray(ppointerdef(p)^.pointertype.def)));
+      end;
+
 
     { true if p is a voidpointer def }
     function is_voidpointer(p : pdef) : boolean;
@@ -1743,7 +1766,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.35  2001-03-03 12:38:33  jonas
+  Revision 1.36  2001-03-23 00:16:07  florian
+    + some stuff to compile FreeCLX added
+
+  Revision 1.35  2001/03/03 12:38:33  jonas
     + support for arraydefs in is_signed (for their rangetype, used in rangechecks)
 
   Revision 1.34  2001/02/26 19:44:55  peter