فهرست منبع

- removed FPC_HAS_STR_CURRENCY-related code, FPC 2.6.4 has it

git-svn-id: trunk@31692 -
Jonas Maebe 10 سال پیش
والد
کامیت
2afd8eb802

+ 0 - 1
compiler/options.pas

@@ -3248,7 +3248,6 @@ begin
   def_system_macro('VER'+version_nr+'_'+release_nr+'_'+patch_nr);
 
 { Temporary defines, until things settle down }
-  def_system_macro('FPC_HAS_STR_CURRENCY');
   def_system_macro('FPC_REAL2REAL_FIXED');
   def_system_macro('FPC_STRTOCHARARRAYPROC');
   def_system_macro('FPC_STRTOSHORTSTRINGPROC');

+ 0 - 2
compiler/pexpr.pas

@@ -1595,11 +1595,9 @@ implementation
         else
 {$endif FPC_REAL2REAL_FIXED}
           result:=crealconstnode.create(d,pbestrealtype^);
-{$ifdef FPC_HAS_STR_CURRENCY}
         val(pattern,cur,code);
         if code=0 then
           trealconstnode(result).value_currency:=cur;
-{$endif FPC_HAS_STR_CURRENCY}
       end;
 
 {---------------------------------------------

+ 0 - 24
packages/rtl-objpas/src/inc/cvarutil.inc

@@ -663,9 +663,6 @@ Function WStrToCurrency(p: Pointer) : Currency;
 var
   s     : ShortString;
   Error : Word;
-  {$IFNDEF FPC_HAS_STR_CURRENCY}
-  Temp  : Extended;
-  {$ENDIF FPC_HAS_STR_CURRENCY}
 begin
   if Length(WideString(p)) > 255 then
     VariantTypeMismatch(varOleStr, varCurrency);
@@ -673,12 +670,7 @@ begin
   s := WideString(p);
   PrepareFloatStr(s);
 
-  {$IFDEF FPC_HAS_STR_CURRENCY}
   Val(s, Result, Error);
-  {$ELSE FPC_HAS_STR_CURRENCY} { needed for platforms where Currency = Int64 }
-  Val(s, Temp, Error);
-  Result := Temp;
-  {$ENDIF FPC_HAS_STR_CURRENCY}
 
   if Error <> 0 then
     VariantTypeMismatch(varOleStr, varCurrency);
@@ -688,9 +680,6 @@ Function LStrToCurrency(p: Pointer) : Currency;
 var
   s     : ShortString;
   Error : Word;
-  {$IFNDEF FPC_HAS_STR_CURRENCY}
-  Temp  : Extended;
-  {$ENDIF FPC_HAS_STR_CURRENCY}
 begin
   if Length(AnsiString(p)) > 255 then
     VariantTypeMismatch(varString, varCurrency);
@@ -698,12 +687,7 @@ begin
   s := AnsiString(p);
   PrepareFloatStr(s);
 
-  {$IFDEF FPC_HAS_STR_CURRENCY}
   Val(s, Result, Error);
-  {$ELSE FPC_HAS_STR_CURRENCY} { needed for platforms where Currency = Int64 }
-  Val(s, Temp, Error);
-  Result := Temp;
-  {$ENDIF FPC_HAS_STR_CURRENCY}
 
   if Error <> 0 then
     VariantTypeMismatch(varString, varCurrency);
@@ -713,9 +697,6 @@ Function UStrToCurrency(p: Pointer) : Currency;
 var
   s     : ShortString;
   Error : Word;
-  {$IFNDEF FPC_HAS_STR_CURRENCY}
-  Temp  : Extended;
-  {$ENDIF FPC_HAS_STR_CURRENCY}
 begin
   if Length(UnicodeString(p)) > 255 then
     VariantTypeMismatch(varUString, varCurrency);
@@ -723,12 +704,7 @@ begin
   s := UnicodeString(p);
   PrepareFloatStr(s);
 
-  {$IFDEF FPC_HAS_STR_CURRENCY}
   Val(s, Result, Error);
-  {$ELSE FPC_HAS_STR_CURRENCY} { needed for platforms where Currency = Int64 }
-  Val(s, Temp, Error);
-  Result := Temp;
-  {$ENDIF FPC_HAS_STR_CURRENCY}
 
   if Error <> 0 then
     VariantTypeMismatch(varUString, varCurrency);

+ 0 - 2
rtl/inc/astrings.inc

@@ -1242,7 +1242,6 @@ end;
 {$endif FPC_STR_ENUM_INTERN}
 
 
-{$ifdef FPC_HAS_STR_CURRENCY}
 procedure fpc_AnsiStr_Currency(c : currency;len,fr : SizeInt;out s : RawByteString{$ifdef FPC_HAS_CPSTRING};cp : TSystemCodePage{$endif FPC_HAS_CPSTRING});[public,alias:'FPC_ANSISTR_CURRENCY']; compilerproc; inline;
 var
   ss: ShortString;
@@ -1253,7 +1252,6 @@ begin
   SetCodePage(s,cp,false);
   {$endif FPC_HAS_CPSTRING}
 end;
-{$endif FPC_HAS_STR_CURRENCY}
 
 Procedure fpc_AnsiStr_UInt(v : ValUInt;Len : SizeInt; out S : RawByteString{$ifdef FPC_HAS_CPSTRING};cp : TSystemCodePage{$endif FPC_HAS_CPSTRING});[Public,Alias : 'FPC_ANSISTR_VALUINT']; compilerproc; inline;
 Var

+ 0 - 10
rtl/inc/compproc.inc

@@ -93,9 +93,7 @@ procedure fpc_AnsiStr_Float(d : ValReal;len,fr,rt : SizeInt;out s : RawByteStrin
 {$endif}
 procedure fpc_ansistr_enum(ordinal,len:sizeint;typinfo,ord2strindex:pointer;out s:RawByteString{$ifdef FPC_HAS_CPSTRING};cp : TSystemCodePage{$endif FPC_HAS_CPSTRING}); compilerproc;
 procedure fpc_ansistr_bool(b : boolean;len:sizeint;out s:RawByteString{$ifdef FPC_HAS_CPSTRING};cp : TSystemCodePage{$endif FPC_HAS_CPSTRING}); compilerproc;
-{$ifdef FPC_HAS_STR_CURRENCY}
 procedure fpc_AnsiStr_Currency(c : currency;len,fr : SizeInt;out s : RawByteString{$ifdef FPC_HAS_CPSTRING};cp : TSystemCodePage{$endif FPC_HAS_CPSTRING}); compilerproc;
-{$endif FPC_HAS_STR_CURRENCY}
 {$endif FPC_HAS_FEATURE_ANSISTRINGS}
 
 {$ifdef FPC_HAS_FEATURE_WIDESTRINGS}
@@ -170,18 +168,14 @@ procedure fpc_AnsiStr_Currency(c : currency;len,fr : SizeInt;out s : RawByteStri
     {$endif}
     procedure fpc_widestr_enum(ordinal,len:sizeint;typinfo,ord2strindex:pointer;out s:widestring);compilerproc;
     procedure fpc_widestr_bool(b : boolean;len:sizeint;out s:widestring);compilerproc;
-    {$ifdef FPC_HAS_STR_CURRENCY}
     procedure fpc_WideStr_Currency(c : Currency;len,fr : SizeInt;out s : WideString);compilerproc;
-    {$endif FPC_HAS_STR_CURRENCY}
   {$endif ndef FPC_WIDESTRING_EQUAL_UNICODESTRING}
     {$ifndef FPUNONE}
     procedure fpc_UnicodeStr_Float(d : ValReal;len,fr,rt : SizeInt;out s : UnicodeString); compilerproc;
     {$endif}
     procedure fpc_unicodestr_enum(ordinal,len:sizeint;typinfo,ord2strindex:pointer;out s:unicodestring);compilerproc;
     procedure fpc_unicodestr_bool(b : boolean;len:sizeint;out s:unicodestring);compilerproc;
-    {$ifdef FPC_HAS_STR_CURRENCY}
     procedure fpc_UnicodeStr_Currency(c : Currency;len,fr : SizeInt;out s : UnicodeString);compilerproc;
-    {$endif FPC_HAS_STR_CURRENCY}
 {$endif FPC_HAS_FEATURE_WIDESTRINGS}
 
 {$ifndef FPUNONE}
@@ -196,9 +190,7 @@ procedure fpc_chararray_enum(ordinal,len:sizeint;typinfo,ord2strindex:pointer;ou
 {$endif CPUAVR}
 
 procedure fpc_chararray_bool(b : boolean;len:sizeint;out a : array of char);compilerproc;
-{$ifdef FPC_HAS_STR_CURRENCY}
 procedure fpc_chararray_Currency(c : Currency;len,fr : SizeInt;out a : array of char);compilerproc;
-{$endif FPC_HAS_STR_CURRENCY}
 
 { Val() support }
 {$ifndef FPUNONE}
@@ -459,9 +451,7 @@ Procedure fpc_Write_Text_Float(rt,fixkomma,Len : Longint;var t : Text;r : ValRea
 Procedure fpc_Write_Text_Float_Iso(rt,fixkomma,Len : Longint;var t : Text;r : ValReal); compilerproc;
 {$endif}
 procedure fpc_write_text_enum(typinfo,ord2strindex:pointer;len:sizeint;var t:text;ordinal:longint); compilerproc;
-{$ifdef FPC_HAS_STR_CURRENCY}
 Procedure fpc_Write_Text_Currency(fixkomma,Len : Longint;var t : Text;c : Currency); compilerproc;
-{$endif FPC_HAS_STR_CURRENCY}
 Procedure fpc_Write_Text_Boolean(Len : Longint;var t : Text;b : Boolean); compilerproc;
 Procedure fpc_Write_Text_Boolean_Iso(Len : Longint;var t : Text;b : Boolean); compilerproc;
 Procedure fpc_Write_Text_Char(Len : Longint;var t : Text;c : Char); compilerproc;

+ 1 - 1
rtl/inc/sstrings.inc

@@ -1061,7 +1061,7 @@ begin
   fpc_shortstr_chararray_intern_charmove(ss,a,maxlen);
 end;
 {$endif EXCLUDE_COMPLEX_PROCS}
-{$endif FPC_HAS_STR_CURRENCY}
+{$endif FPC_HAS_CHARARRAY_CURRENCY}
 
 {*****************************************************************************
                            Val() Functions

+ 0 - 3
rtl/inc/text.inc

@@ -1233,7 +1233,6 @@ begin
 {$endif EXCLUDE_COMPLEX_PROCS}
 end;
 
-{$ifdef FPC_HAS_STR_CURRENCY}
 Procedure fpc_Write_Text_Currency(fixkomma,Len : Longint;var t : Text;c : Currency); iocheck; compilerproc;
 {$ifdef EXCLUDE_COMPLEX_PROCS}
       begin
@@ -1250,8 +1249,6 @@ Begin
 End;
 {$endif EXCLUDE_COMPLEX_PROCS}
 
-{$endif FPC_HAS_STR_CURRENCY}
-
 Procedure fpc_Write_Text_Boolean(Len : Longint;var t : Text;b : Boolean); iocheck; compilerproc;
 Begin
   If (InOutRes<>0) then

+ 0 - 2
rtl/inc/ustrings.inc

@@ -1577,7 +1577,6 @@ begin
   s:=UnicodeString(ss);
 end;
 
-{$ifdef FPC_HAS_STR_CURRENCY}
 procedure fpc_UnicodeStr_Currency(c : Currency;len,fr : SizeInt;out s : UnicodeString);compilerproc;
 var
   ss: shortstring;
@@ -1585,7 +1584,6 @@ begin
   str(c:len:fr,ss);
   s:=UnicodeString(ss);
 end;
-{$endif FPC_HAS_STR_CURRENCY}
 
 Procedure fpc_UnicodeStr_SInt(v : ValSint; Len : SizeInt; out S : UnicodeString);compilerproc;
 Var

+ 0 - 2
rtl/inc/wstrings.inc

@@ -881,7 +881,6 @@ begin
   s:=WideString(ss);
 end;
 
-{$ifdef FPC_HAS_STR_CURRENCY}
 procedure fpc_WideStr_Currency(c : Currency;len,fr : SizeInt;out s : WideString);compilerproc;
 var
   ss: ShortString;
@@ -889,7 +888,6 @@ begin
   str(c:len:fr,ss);
   s:=WideString(ss);
 end;
-{$endif FPC_HAS_STR_CURRENCY}
 
 Procedure fpc_WideStr_SInt(v : ValSint; Len : SizeInt; out S : WideString);compilerproc;
 Var

+ 0 - 10
rtl/java/jcompproc.inc

@@ -103,9 +103,7 @@ procedure fpc_AnsiStr_Float(d : ValReal;len,fr,rt : SizeInt;out s : RawByteStrin
 procedure fpc_ansistr_enum(ordinal,len:sizeint;typinfo,ord2strindex:pointer;out s:RawByteString{$ifdef FPC_HAS_CPSTRING};cp : TSystemCodePage{$endif FPC_HAS_CPSTRING}); compilerproc;
 {$endif FPC_STR_ENUM_INTERN}
 procedure fpc_ansistr_bool(b : boolean;len:sizeint;out s:RawByteString{$ifdef FPC_HAS_CPSTRING};cp : TSystemCodePage{$endif FPC_HAS_CPSTRING}); compilerproc;
-{$ifdef FPC_HAS_STR_CURRENCY}
 procedure fpc_AnsiStr_Currency(c : currency;len,fr : SizeInt;out s : RawByteString{$ifdef FPC_HAS_CPSTRING};cp : TSystemCodePage{$endif FPC_HAS_CPSTRING}); compilerproc;
-{$endif FPC_HAS_STR_CURRENCY}
 {$endif FPC_HAS_FEATURE_ANSISTRINGS}
 
 {$ifdef FPC_HAS_FEATURE_WIDESTRINGS}
@@ -181,9 +179,7 @@ procedure fpc_AnsiStr_Currency(c : currency;len,fr : SizeInt;out s : RawByteStri
     procedure fpc_widestr_enum(ordinal,len:sizeint;typinfo,ord2strindex:pointer;out s:widestring);compilerproc;
     {$endif FPC_STR_ENUM_INTERN}
     procedure fpc_widestr_bool(b : boolean;len:sizeint;out s:widestring);compilerproc;
-    {$ifdef FPC_HAS_STR_CURRENCY}
     procedure fpc_WideStr_Currency(c : Currency;len,fr : SizeInt;out s : WideString);compilerproc;
-    {$endif FPC_HAS_STR_CURRENCY}
   {$endif ndef FPC_WIDESTRING_EQUAL_UNICODESTRING}
     {$ifndef FPUNONE}
     procedure fpc_UnicodeStr_Float(d : ValReal;len,fr,rt : SizeInt;out s : UnicodeString); compilerproc;
@@ -192,9 +188,7 @@ procedure fpc_AnsiStr_Currency(c : currency;len,fr : SizeInt;out s : RawByteStri
     procedure fpc_unicodestr_enum(ordinal,len:sizeint;typinfo,ord2strindex:pointer;out s:unicodestring);compilerproc;
     {$endif FPC_STR_ENUM_INTERN}
     procedure fpc_unicodestr_bool(b : boolean;len:sizeint;out s:unicodestring);compilerproc;
-    {$ifdef FPC_HAS_STR_CURRENCY}
     procedure fpc_UnicodeStr_Currency(c : Currency;len,fr : SizeInt;out s : UnicodeString);compilerproc;
-    {$endif FPC_HAS_STR_CURRENCY}
 {$endif FPC_HAS_FEATURE_WIDESTRINGS}
 
 {$ifndef FPUNONE}
@@ -204,9 +198,7 @@ procedure fpc_chararray_Float(d : ValReal;len,fr,rt : SizeInt;out a : array of A
 procedure fpc_chararray_enum(ordinal,len:sizeint;typinfo,ord2strindex:pointer;out a : array of AnsiChar);compilerproc;
 {$endif}
 procedure fpc_chararray_bool(b : boolean;len:sizeint;out a : array of AnsiChar);compilerproc;
-{$ifdef FPC_HAS_STR_CURRENCY}
 procedure fpc_chararray_Currency(c : Currency;len,fr : SizeInt;out a : array of AnsiChar);compilerproc;
-{$endif FPC_HAS_STR_CURRENCY}
 
 { Val() support }
 {$ifndef FPUNONE}
@@ -476,9 +468,7 @@ Procedure fpc_Write_Text_Float(rt,fixkomma,Len : Longint;var t : Text;r : ValRea
 Procedure fpc_Write_Text_Float_Iso(rt,fixkomma,Len : Longint;var t : Text;r : ValReal); compilerproc;
 {$endif}
 procedure fpc_write_text_enum(typinfo,ord2strindex:pointer;len:sizeint;var t:text;ordinal:longint); compilerproc;
-{$ifdef FPC_HAS_STR_CURRENCY}
 Procedure fpc_Write_Text_Currency(fixkomma,Len : Longint;var t : Text;c : Currency); compilerproc;
-{$endif FPC_HAS_STR_CURRENCY}
 Procedure fpc_Write_Text_Boolean(Len : Longint;var t : Text;b : Boolean); compilerproc;
 Procedure fpc_Write_Text_Boolean_Iso(Len : Longint;var t : Text;b : Boolean); compilerproc;
 Procedure fpc_Write_Text_Char(Len : Longint;var t : Text;c : Char); compilerproc;

+ 0 - 31
rtl/objpas/sysutils/sysstr.inc

@@ -1062,9 +1062,6 @@ Function TextToFloat(Buffer: PChar; Out Value; ValueType: TFloatValue; Const For
 Var
   E,P : Integer;
   S : String;
-{$ifndef FPC_HAS_STR_CURRENCY}
-  TempValue: extended;
-{$endif FPC_HAS_STR_CURRENCY}
 
 Begin
   S:=StrPas(Buffer);
@@ -1088,15 +1085,7 @@ Begin
   try
     case ValueType of
       fvCurrency:
-{$ifdef FPC_HAS_STR_CURRENCY}
         Val(S,Currency(Value),E);
-{$else FPC_HAS_STR_CURRENCY}
-        begin
-          // needed for platforms where Currency = Int64
-          Val(S,TempValue,E);
-          Currency(Value) := TempValue;
-        end;
-{$endif FPC_HAS_STR_CURRENCY}
       fvExtended:
         Val(S,Extended(Value),E);
       fvDouble:
@@ -1219,11 +1208,7 @@ Begin
           fvSingle:
             Str(Single(Extended(Aligned(Value))):precision+6, Result);
           fvCurrency:
-{$ifdef FPC_HAS_STR_CURRENCY}
             Str(Currency(Aligned(Value)):precision+6, Result);
-{$else}
-            Str(Extended(Currency(Aligned(Value))):precision+8, Result);
-{$endif FPC_HAS_STR_CURRENCY}
           else
             Str(Extended(Aligned(Value)):precision+8, Result);
         end;
@@ -1316,11 +1301,7 @@ Begin
           fvSingle:
             Str(Single(Extended(Aligned(Value))):Precision+6, Result);
           fvCurrency:
-{$ifdef FPC_HAS_STR_CURRENCY}
             Str(Currency(Aligned(Value)):Precision+6, Result);
-{$else}
-            Str(Extended(Currency(Aligned(Value))):Precision+8, Result);
-{$endif FPC_HAS_STR_CURRENCY}
           else
             Str(Extended(Aligned(Value)):Precision+8, Result);
         end;
@@ -1369,11 +1350,7 @@ Begin
           fvSingle:
             Str(Single(Extended(Aligned(Value))):0:Digits, Result);
           fvCurrency:
-{$ifdef FPC_HAS_STR_CURRENCY}
             Str(Currency(Aligned(Value)):0:Digits, Result);
-{$else}
-            Str(Extended(Currency(Aligned(Value))):0:Digits, Result);
-{$endif FPC_HAS_STR_CURRENCY}
           else
             Str(Extended(Aligned(Value)):0:Digits, Result);
         end;
@@ -1394,11 +1371,7 @@ Begin
           fvSingle:
             Str(Single(Extended(Aligned(Value))):0:Digits, Result);
           fvCurrency:
-{$ifdef FPC_HAS_STR_CURRENCY}
             Str(Currency(Aligned(Value)):0:Digits, Result);
-{$else}
-            Str(Extended(Currency(Aligned(Value))):0:Digits, Result);
-{$endif FPC_HAS_STR_CURRENCY}
           else
             Str(Extended(Aligned(Value)):0:Digits, Result);
         end;
@@ -1428,11 +1401,7 @@ Begin
           fvSingle:
             Str(Single(Extended(Aligned(Value))):0:Digits, Result);
           fvCurrency:
-{$ifdef FPC_HAS_STR_CURRENCY}
             Str(Currency(Aligned(Value)):0:Digits, Result);
-{$else}
-            Str(Extended(Currency(Aligned(Value))):0:Digits, Result);
-{$endif FPC_HAS_STR_CURRENCY}
           else
             Str(Extended(Aligned(Value)):0:Digits, Result);
         end;