2
0
Эх сурвалжийг харах

* Do not fill generic upcase and lowcase conversion tables for windows targets, because generic ANSI routines are not used here.

git-svn-id: trunk@9049 -
yury 18 жил өмнө
parent
commit
220a37b443

+ 2 - 0
rtl/objpas/sysutils/sysinth.inc

@@ -55,10 +55,12 @@ type
   end;
 
 var
+{$ifndef FPC_NOGENERICANSIROUTINES}
    { Tables with upper and lowercase forms of character sets.
      MUST be initialized with the correct code-pages }
    UpperCaseTable: TCaseTranslationTable;
    LowerCaseTable: TCaseTranslationTable;
+{$endif FPC_NOGENERICANSIROUTINES}
 
   DefaultFormatSettings : TFormatSettings = (
     CurrencyFormat: 1;

+ 17 - 13
rtl/objpas/sysutils/sysstr.inc

@@ -213,6 +213,7 @@ begin
  Result:=CompareText(S1,S2)=0;
 end;
 
+{$ifndef FPC_NOGENERICANSIROUTINES}
 {==============================================================================}
 {   Ansi string functions                                                      }
 {   these functions rely on the character set loaded by the OS                 }
@@ -274,18 +275,6 @@ begin
     Result:=L1-L2;
 end;
 
-function AnsiSameText(const s1,s2:String):Boolean;{$ifdef SYSUTILSINLINE}inline;{$endif}
-
-begin
- AnsiSameText:=AnsiCompareText(S1,S2)=0;
-end;
-
-function AnsiSameStr(const s1,s2:String):Boolean;{$ifdef SYSUTILSINLINE}inline;{$endif}
-
-begin
-  AnsiSameStr:=AnsiCompareStr(S1,S2)=0;
-end;
-
 function GenericAnsiStrComp(S1, S2: PChar): PtrInt;
 
 begin
@@ -415,6 +404,19 @@ if Str <> Nil then begin
       end ;
    end ;
 end ;
+{$endif FPC_NOGENERICANSIROUTINES}
+
+function AnsiSameText(const s1,s2:String):Boolean;{$ifdef SYSUTILSINLINE}inline;{$endif}
+
+begin
+ AnsiSameText:=AnsiCompareText(S1,S2)=0;
+end;
+
+function AnsiSameStr(const s1,s2:String):Boolean;{$ifdef SYSUTILSINLINE}inline;{$endif}
+
+begin
+  AnsiSameStr:=AnsiCompareStr(S1,S2)=0;
+end;
 
 function AnsiLastChar(const S: string): PChar;
 
@@ -2588,12 +2590,13 @@ begin
 end;
 
 
+{$ifndef FPC_NOGENERICANSIROUTINES}
 {
    Case Translation Tables
    Can be used in internationalization support.
 
    Although these tables can be obtained through system calls
-   it is better to not use those, since most implementation are not 100%
+cd    it is better to not use those, since most implementation are not 100%
    WARNING:
    before modifying a translation table make sure that the current codepage
    of the OS corresponds to the one you make changes to
@@ -2646,6 +2649,7 @@ const
      #240, #241, #242, #243, #244, #245, #246, #247,
      #248, #249, #250, #251, #252, #253, #254, #255 );
 
+{$endif FPC_NOGENERICANSIROUTINES}
 
 function sscanf(const s: string; const fmt : string;const Pointers : array of Pointer) : Integer;
   var

+ 0 - 24
rtl/win/sysutils.pp

@@ -613,29 +613,6 @@ end;
                               Locale Functions
 ****************************************************************************}
 
-Procedure InitAnsi;
-Var
-  i : longint;
-begin
-  {  Fill table entries 0 to 127  }
-  for i := 0 to 96 do
-    UpperCaseTable[i] := chr(i);
-  for i := 97 to 122 do
-    UpperCaseTable[i] := chr(i - 32);
-  for i := 123 to 191 do
-    UpperCaseTable[i] := chr(i);
-  Move (CPISO88591UCT,UpperCaseTable[192],SizeOf(CPISO88591UCT));
-
-  for i := 0 to 64 do
-    LowerCaseTable[i] := chr(i);
-  for i := 65 to 90 do
-    LowerCaseTable[i] := chr(i + 32);
-  for i := 91 to 191 do
-    LowerCaseTable[i] := chr(i);
-  Move (CPISO88591LCT,UpperCaseTable[192],SizeOf(CPISO88591UCT));
-end;
-
-
 function GetLocaleStr(LID, LT: Longint; const Def: string): ShortString;
 var
   L: Integer;
@@ -732,7 +709,6 @@ begin
   // probably needs update with getthreadlocale. post 2.0.2
 
   Set8087CW(old8087CW);
-  InitAnsi;
   GetFormatSettings;
 end;
 

+ 0 - 24
rtl/wince/sysutils.pp

@@ -485,29 +485,6 @@ end;
                               Locale Functions
 ****************************************************************************}
 
-Procedure InitAnsi;
-Var
-  i : longint;
-begin
-  {  Fill table entries 0 to 127  }
-  for i := 0 to 96 do
-    UpperCaseTable[i] := chr(i);
-  for i := 97 to 122 do
-    UpperCaseTable[i] := chr(i - 32);
-  for i := 123 to 191 do
-    UpperCaseTable[i] := chr(i);
-  Move (CPISO88591UCT,UpperCaseTable[192],SizeOf(CPISO88591UCT));
-
-  for i := 0 to 64 do
-    LowerCaseTable[i] := chr(i);
-  for i := 65 to 90 do
-    LowerCaseTable[i] := chr(i + 32);
-  for i := 91 to 191 do
-    LowerCaseTable[i] := chr(i);
-  Move (CPISO88591LCT,UpperCaseTable[192],SizeOf(CPISO88591UCT));
-end;
-
-
 function GetLocaleStr(LID, LT: Longint; const Def: string): ShortString;
 var
   L: Integer;
@@ -614,7 +591,6 @@ begin
   InitInternationalGeneric;
   SysLocale.MBCS:=GetSystemMetrics(SM_DBCSENABLED)<>0;
   SysLocale.RightToLeft:=GetSystemMetrics(SM_MIDEASTENABLED)<>0;
-  InitAnsi;
   GetFormatSettings;
 end;