Selaa lähdekoodia

* bootstrapping for systems where currency is not a float

git-svn-id: trunk@5865 -
Jonas Maebe 18 vuotta sitten
vanhempi
commit
2fa51a485f
5 muutettua tiedostoa jossa 13 lisäystä ja 5 poistoa
  1. 1 0
      compiler/options.pas
  2. 2 1
      rtl/inc/astrings.inc
  3. 6 0
      rtl/inc/compproc.inc
  4. 2 2
      rtl/inc/sstrings.inc
  5. 2 2
      rtl/inc/wstrings.inc

+ 1 - 0
compiler/options.pas

@@ -1911,6 +1911,7 @@ begin
   def_system_macro('FPC_HASINTERNALOLEVARIANT2VARIANTCAST');
   def_system_macro('FPC_HAS_VARSETS');
   def_system_macro('FPC_HAS_VALGRINDBOOL');
+  def_system_macro('FPC_HAS_STR_CURRENCY');
 {$ifdef x86}
   def_system_macro('INTERNAL_BACKTRACE');
 {$endif}

+ 2 - 1
rtl/inc/astrings.inc

@@ -836,6 +836,7 @@ begin
 end;
 
 
+{$ifdef FPC_HAS_STR_CURRENCY}
 procedure fpc_AnsiStr_Currency(c : currency;len,fr : SizeInt;out s : ansistring);[public,alias:'FPC_ANSISTR_CURRENCY']; compilerproc; {$IFNDEF VER2_0} Inline; {$ENDIF}
 var
   ss: ShortString;
@@ -843,7 +844,7 @@ begin
   str(c:len:fr,ss);
   s:=ss;
 end;
-
+{$endif FPC_HAS_STR_CURRENCY}
 
 Procedure fpc_AnsiStr_UInt(v : ValUInt;Len : SizeInt; out S : AnsiString);[Public,Alias : 'FPC_ANSISTR_VALUINT']; compilerproc; {$IFNDEF VER2_0} Inline; {$ENDIF}
 Var

+ 6 - 0
rtl/inc/compproc.inc

@@ -81,7 +81,9 @@ procedure fpc_chararray_uint(v : valuint;len : SizeInt;out a : array of char); c
 procedure fpc_AnsiStr_sint(v : valsint; Len : SizeInt; out S : AnsiString); compilerproc;
 procedure fpc_AnsiStr_uint(v : valuint;Len : SizeInt; out S : AnsiString); compilerproc;
 procedure fpc_AnsiStr_Float(d : ValReal;len,fr,rt : SizeInt;out s : ansistring); compilerproc;
+{$ifdef FPC_HAS_STR_CURRENCY}
 procedure fpc_AnsiStr_Currency(c : currency;len,fr : SizeInt;out s : ansistring); compilerproc;
+{$endif FPC_HAS_STR_CURRENCY}
 {$endif FPC_HAS_FEATURE_ANSISTRINGS}
 
 {$ifdef FPC_HAS_FEATURE_WIDESTRINGS}
@@ -105,11 +107,15 @@ procedure fpc_WideStr_uint(v : valuint;Len : SizeInt; out S : WideString); compi
 {$endif CPU64}
 {$ifdef FPC_HAS_FEATURE_WIDESTRINGS}
 procedure fpc_WideStr_Float(d : ValReal;len,fr,rt : 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 FPC_HAS_FEATURE_WIDESTRINGS}
 
 procedure fpc_chararray_Float(d : ValReal;len,fr,rt : 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 }
 Function fpc_Val_Real_ShortStr(const s : shortstring; out code : ValSInt): ValReal; compilerproc;

+ 2 - 2
rtl/inc/sstrings.inc

@@ -626,7 +626,7 @@ begin
   move(ss[1],pchar(@a)^,maxlen);
 end;
 
-
+{$ifdef FPC_HAS_STR_CURRENCY}
 procedure fpc_chararray_Currency(c : Currency;len,fr : SizeInt;out a : array of char);compilerproc;
 var
   ss : shortstring;
@@ -639,7 +639,7 @@ begin
     maxlen:=high(a)+1;
   move(ss[1],pchar(@a)^,maxlen);
 end;
-
+{$endif FPC_HAS_STR_CURRENCY}
 
 {*****************************************************************************
                            Val() Functions

+ 2 - 2
rtl/inc/wstrings.inc

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