Browse Source

Fix compilation for win16 OS by using USE_WINDOWS_UNIT macro, defined for other Windows OSes

Pierre Muller 2 months ago
parent
commit
80883ee7c0
1 changed files with 11 additions and 5 deletions
  1. 11 5
      packages/rtl-unicode/src/inc/utf8utils.pp

+ 11 - 5
packages/rtl-unicode/src/inc/utf8utils.pp

@@ -24,16 +24,22 @@ unit UTF8Utils;
 {$WARN 6058 off : Call to subroutine "$1" marked as inline is not inlined}
 {$WARN 6058 off : Call to subroutine "$1" marked as inline is not inlined}
 {$ENDIF}
 {$ENDIF}
 
 
+{$ifdef windows}
+  {$ifndef win16}
+    {$define USE_WINDOWS_UNIT}
+  {$endif not win16}
+{$endif windows}
+
 interface
 interface
 
 
 uses
 uses
 {$IFNDEF FPC_DOTTEDUNITS}
 {$IFNDEF FPC_DOTTEDUNITS}
-  {$ifdef windows}
+  {$ifdef USE_WINDOWS_UNIT}
   Windows,
   Windows,
   {$endif}
   {$endif}
   SysUtils, StrUtils;
   SysUtils, StrUtils;
 {$ELSE}
 {$ELSE}
-  {$ifdef windows}
+  {$ifdef USE_WINDOWS_UNIT}
   WinApi.Windows,
   WinApi.Windows,
   {$endif}
   {$endif}
   System.SysUtils, System.StrUtils;
   System.SysUtils, System.StrUtils;
@@ -222,7 +228,7 @@ begin
 end;
 end;
 
 
 
 
-{$IFDEF WINDOWS}
+{$IFDEF USE_WINDOWS_UNIT}
 
 
   {$ifdef WinCE}
   {$ifdef WinCE}
   function ConsoleToUTF8(const s: AnsiString): AnsiString;// converts console encoding to UTF8
   function ConsoleToUTF8(const s: AnsiString): AnsiString;// converts console encoding to UTF8
@@ -334,7 +340,7 @@ end;
   end;
   end;
   {$endif not wince}
   {$endif not wince}
 
 
-{$ELSE WINDOWS}
+{$ELSE USE_WINDOWS_UNIT}
 
 
   function ConsoleToUTF8(const s: AnsiString): AnsiString;// converts UTF8 AnsiString to console encoding (used by Write, WriteLn)
   function ConsoleToUTF8(const s: AnsiString): AnsiString;// converts UTF8 AnsiString to console encoding (used by Write, WriteLn)
   begin
   begin
@@ -371,7 +377,7 @@ end;
 
 
 
 
 
 
-{$ENDIF WINDOWS}
+{$ENDIF USE_WINDOWS_UNIT}
 
 
 var
 var
   FNeedRTLAnsi: boolean = false;
   FNeedRTLAnsi: boolean = false;