Browse Source

* WChar fix to compile also with 1.0.x

peter 24 years ago
parent
commit
c3da2af2ad
3 changed files with 47 additions and 6 deletions
  1. 13 2
      rtl/inc/systemh.inc
  2. 22 3
      rtl/win32/crt.pp
  3. 12 1
      rtl/win32/video.pp

+ 13 - 2
rtl/inc/systemh.inc

@@ -146,7 +146,15 @@ Type
 {$ifdef HASWIDECHAR}
 {$ifdef HASWIDECHAR}
   PWideChar           = ^WideChar;
   PWideChar           = ^WideChar;
   PPWideChar          = ^PWideChar;
   PPWideChar          = ^PWideChar;
-  wchar               = Widechar;
+  { 1.0.x also has HASWIDECHAR defined, but doesn't support it
+    fully, setting WChar to Word as fallback (PFV) }
+  {$ifndef VER1_0}
+  WChar               = Widechar;
+  {$else}
+  WChar               = Word;
+  {$endif}
+{$else}
+  WChar               = Word;
 {$endif HASWIDECHAR}
 {$endif HASWIDECHAR}
 {$ifdef HASWIDESTRING}
 {$ifdef HASWIDESTRING}
   PWideString         = ^WideString;
   PWideString         = ^WideString;
@@ -538,7 +546,10 @@ const
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.33  2001-08-01 15:00:11  jonas
+  Revision 1.34  2001-08-01 18:01:20  peter
+    * WChar fix to compile also with 1.0.x
+
+  Revision 1.33  2001/08/01 15:00:11  jonas
     + "compproc" helpers
     + "compproc" helpers
     * renamed several helpers so that their name is the same as their
     * renamed several helpers so that their name is the same as their
       "public alias", which should facilitate the conversion of processor
       "public alias", which should facilitate the conversion of processor

+ 22 - 3
rtl/win32/crt.pp

@@ -524,7 +524,15 @@ var
   DestCoor: TCoord;
   DestCoor: TCoord;
   CharInfo: TCharInfo;
   CharInfo: TCharInfo;
 begin
 begin
-  CharInfo.UnicodeChar := #32;
+{$ifdef HASWIDECHAR}
+  {$ifdef VER1_0}
+    CharInfo.UnicodeChar := 32;
+  {$else}
+    CharInfo.UnicodeChar := #32;
+  {$endif}
+{$else}
+  CharInfo.UnicodeChar := 32;
+{$endif}
   CharInfo.Attributes := TextAttr;
   CharInfo.Attributes := TextAttr;
 
 
   Y := (WindMinY - 1) + (Y - 1) + 1;
   Y := (WindMinY - 1) + (Y - 1) + 1;
@@ -561,7 +569,15 @@ var
 begin
 begin
   GetScreenCursor(X, Y);
   GetScreenCursor(X, Y);
 
 
-  CharInfo.UnicodeChar := #32;
+{$ifdef HASWIDECHAR}
+  {$ifdef VER1_0}
+    CharInfo.UnicodeChar := 32;
+  {$else}
+    CharInfo.UnicodeChar := #32;
+  {$endif}
+{$else}
+  CharInfo.UnicodeChar := 32;
+{$endif}
   CharInfo.Attributes := TextAttr;
   CharInfo.Attributes := TextAttr;
 
 
   SrcRect.Top := Y - 1;
   SrcRect.Top := Y - 1;
@@ -835,7 +851,10 @@ end. { unit Crt }
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.12  2001-07-30 15:00:54  marco
+  Revision 1.13  2001-08-01 18:01:20  peter
+    * WChar fix to compile also with 1.0.x
+
+  Revision 1.12  2001/07/30 15:00:54  marco
    * Fixed unicode reference from word to widechar
    * Fixed unicode reference from word to widechar
 
 
   Revision 1.11  2001/07/13 17:43:25  peter
   Revision 1.11  2001/07/13 17:43:25  peter

+ 12 - 1
rtl/win32/video.pp

@@ -297,7 +297,15 @@ begin
                     if LineCounter>y2 then
                     if LineCounter>y2 then
                       y2:=LineCounter;
                       y2:=LineCounter;
                  end;
                  end;
+{$ifdef HASWIDECHAR}
+  {$ifdef VER1_0}
+               LineBuf^[BufCounter].UniCodeChar := WordRec(VideoBuf^[BufCounter]).One;
+  {$else}
                LineBuf^[BufCounter].UniCodeChar := Widechar(WordRec(VideoBuf^[BufCounter]).One);
                LineBuf^[BufCounter].UniCodeChar := Widechar(WordRec(VideoBuf^[BufCounter]).One);
+  {$endif}
+{$else}
+               LineBuf^[BufCounter].UniCodeChar := WordRec(VideoBuf^[BufCounter]).One);
+{$endif}
                { If (WordRec(VideoBuf^[BufCounter]).Two and $80)<>0 then
                { If (WordRec(VideoBuf^[BufCounter]).Two and $80)<>0 then
                  LineBuf^[BufCounter].Attributes := $100+WordRec(VideoBuf^[BufCounter]).Two
                  LineBuf^[BufCounter].Attributes := $100+WordRec(VideoBuf^[BufCounter]).Two
                else }
                else }
@@ -358,7 +366,10 @@ finalization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.4  2001-07-30 15:01:12  marco
+  Revision 1.5  2001-08-01 18:01:20  peter
+    * WChar fix to compile also with 1.0.x
+
+  Revision 1.4  2001/07/30 15:01:12  marco
    * Fixed wchar=word to widechar conversion
    * Fixed wchar=word to widechar conversion
 
 
   Revision 1.3  2001/06/13 18:32:55  peter
   Revision 1.3  2001/06/13 18:32:55  peter