소스 검색

* 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 년 전
부모
커밋
220a37b443
4개의 변경된 파일19개의 추가작업 그리고 61개의 파일을 삭제
  1. 2 0
      rtl/objpas/sysutils/sysinth.inc
  2. 17 13
      rtl/objpas/sysutils/sysstr.inc
  3. 0 24
      rtl/win/sysutils.pp
  4. 0 24
      rtl/wince/sysutils.pp

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

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

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

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

+ 0 - 24
rtl/win/sysutils.pp

@@ -613,29 +613,6 @@ end;
                               Locale Functions
                               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;
 function GetLocaleStr(LID, LT: Longint; const Def: string): ShortString;
 var
 var
   L: Integer;
   L: Integer;
@@ -732,7 +709,6 @@ begin
   // probably needs update with getthreadlocale. post 2.0.2
   // probably needs update with getthreadlocale. post 2.0.2
 
 
   Set8087CW(old8087CW);
   Set8087CW(old8087CW);
-  InitAnsi;
   GetFormatSettings;
   GetFormatSettings;
 end;
 end;
 
 

+ 0 - 24
rtl/wince/sysutils.pp

@@ -485,29 +485,6 @@ end;
                               Locale Functions
                               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;
 function GetLocaleStr(LID, LT: Longint; const Def: string): ShortString;
 var
 var
   L: Integer;
   L: Integer;
@@ -614,7 +591,6 @@ begin
   InitInternationalGeneric;
   InitInternationalGeneric;
   SysLocale.MBCS:=GetSystemMetrics(SM_DBCSENABLED)<>0;
   SysLocale.MBCS:=GetSystemMetrics(SM_DBCSENABLED)<>0;
   SysLocale.RightToLeft:=GetSystemMetrics(SM_MIDEASTENABLED)<>0;
   SysLocale.RightToLeft:=GetSystemMetrics(SM_MIDEASTENABLED)<>0;
-  InitAnsi;
   GetFormatSettings;
   GetFormatSettings;
 end;
 end;