* disable east asia/era stuff on WinCE, the functions does not seem to be available there, fixed compilation of trunk for WinCE

git-svn-id: trunk@15782 -
This commit is contained in:
florian 2010-08-11 20:30:14 +00:00
parent df01446f42
commit 4671615dc7

View File

@ -428,7 +428,7 @@ begin
begin begin
inc(n); inc(n);
if n>3 then if n>3 then
begin begin
FixErrorMsg(SInvalidDateFormat,s); FixErrorMsg(SInvalidDateFormat,s);
exit; exit;
end; end;
@ -705,7 +705,7 @@ Var
begin begin
Result:=IntStrToTime(Msg,S,Len,DefaultFormatSettings,Separator); Result:=IntStrToTime(Msg,S,Len,DefaultFormatSettings,Separator);
If (Msg<>'') then If (Msg<>'') then
Raise EConvertError.Create(Msg); Raise EConvertError.Create(Msg);
end; end;
@ -813,13 +813,13 @@ var
ResultLen: integer; ResultLen: integer;
ResultBuffer: array[0..255] of char; ResultBuffer: array[0..255] of char;
ResultCurrent: pchar; ResultCurrent: pchar;
{$IFDEF Windows} {$IFDEF MSWindows}
isEnable_E_Format : Boolean; isEnable_E_Format : Boolean;
isEnable_G_Format : Boolean; isEnable_G_Format : Boolean;
eastasiainited : boolean; eastasiainited : boolean;
{$ENDIF} {$ENDIF MSWindows}
{$IFDEF Windows} {$IFDEF MSWindows}
procedure InitEastAsia; procedure InitEastAsia;
var ALCID : LCID; var ALCID : LCID;
PriLangID , SubLangID : Word; PriLangID , SubLangID : Word;
@ -850,7 +850,7 @@ var
); );
eastasiainited :=true; eastasiainited :=true;
end; end;
{$ENDIF} {$ENDIF MSWindows}
procedure StoreStr(Str: PChar; Len: Integer); procedure StoreStr(Str: PChar; Len: Integer);
begin begin
@ -866,7 +866,7 @@ var
var Len: integer; var Len: integer;
begin begin
Len := Length(Str); Len := Length(Str);
if ResultLen + Len < SizeOf(ResultBuffer) then if ResultLen + Len < SizeOf(ResultBuffer) then
begin begin
StrMove(ResultCurrent, pchar(Str), Len); StrMove(ResultCurrent, pchar(Str), Len);
ResultCurrent := ResultCurrent + Len; ResultCurrent := ResultCurrent + Len;
@ -1006,7 +1006,7 @@ var
1: StoreInt(Month, 0); 1: StoreInt(Month, 0);
2: StoreInt(Month, 2); 2: StoreInt(Month, 2);
3: StoreString(FormatSettings.ShortMonthNames[Month]); 3: StoreString(FormatSettings.ShortMonthNames[Month]);
else else
StoreString(FormatSettings.LongMonthNames[Month]); StoreString(FormatSettings.LongMonthNames[Month]);
end; end;
end; end;
@ -1018,7 +1018,7 @@ var
3: StoreString(FormatSettings.ShortDayNames[DayOfWeek]); 3: StoreString(FormatSettings.ShortDayNames[DayOfWeek]);
4: StoreString(FormatSettings.LongDayNames[DayOfWeek]); 4: StoreString(FormatSettings.LongDayNames[DayOfWeek]);
5: StoreFormat(FormatSettings.ShortDateFormat, Nesting+1, False); 5: StoreFormat(FormatSettings.ShortDateFormat, Nesting+1, False);
else else
StoreFormat(FormatSettings.LongDateFormat, Nesting+1, False); StoreFormat(FormatSettings.LongDateFormat, Nesting+1, False);
end ; end ;
end ; end ;
@ -1026,32 +1026,32 @@ var
begin begin
tmp := hour mod 12; tmp := hour mod 12;
if tmp=0 then tmp:=12; if tmp=0 then tmp:=12;
if Count = 1 then if Count = 1 then
StoreInt(tmp, 0) StoreInt(tmp, 0)
else else
StoreInt(tmp, 2); StoreInt(tmp, 2);
end end
else begin else begin
if Count = 1 then if Count = 1 then
StoreInt(Hour, 0) StoreInt(Hour, 0)
else else
StoreInt(Hour, 2); StoreInt(Hour, 2);
end; end;
'N': if Count = 1 then 'N': if Count = 1 then
StoreInt(Minute, 0) StoreInt(Minute, 0)
else else
StoreInt(Minute, 2); StoreInt(Minute, 2);
'S': if Count = 1 then 'S': if Count = 1 then
StoreInt(Second, 0) StoreInt(Second, 0)
else else
StoreInt(Second, 2); StoreInt(Second, 2);
'Z': if Count = 1 then 'Z': if Count = 1 then
StoreInt(MilliSecond, 0) StoreInt(MilliSecond, 0)
else else
StoreInt(MilliSecond, 3); StoreInt(MilliSecond, 3);
'T': if Count = 1 then 'T': if Count = 1 then
StoreFormat(FormatSettings.ShortTimeFormat, Nesting+1, True) StoreFormat(FormatSettings.ShortTimeFormat, Nesting+1, True)
else else
StoreFormat(FormatSettings.LongTimeFormat, Nesting+1, True); StoreFormat(FormatSettings.LongTimeFormat, Nesting+1, True);
'C': begin 'C': begin
StoreFormat(FormatSettings.ShortDateFormat, Nesting+1, False); StoreFormat(FormatSettings.ShortDateFormat, Nesting+1, False);
@ -1061,7 +1061,7 @@ var
StoreFormat(FormatSettings.LongTimeFormat, Nesting+1, True); StoreFormat(FormatSettings.LongTimeFormat, Nesting+1, True);
end; end;
end; end;
{$IFDEF Windows} {$IFDEF MSWindows}
'E': 'E':
begin begin
if not Eastasiainited then InitEastAsia; if not Eastasiainited then InitEastAsia;
@ -1088,7 +1088,7 @@ var
end; end;
lastformattoken:=token; lastformattoken:=token;
end; end;
{$ENDIF} {$ENDIF MSWindows}
end; end;
lastformattoken := token; lastformattoken := token;
end; end;
@ -1100,9 +1100,9 @@ var
end; end;
begin begin
{$ifdef windows} {$ifdef MSWindows}
eastasiainited:=false; eastasiainited:=false;
{$endif} {$endif MSWindows}
DecodeDateFully(DateTime, Year, Month, Day, DayOfWeek); DecodeDateFully(DateTime, Year, Month, Day, DayOfWeek);
DecodeTime(DateTime, Hour, Minute, Second, MilliSecond); DecodeTime(DateTime, Hour, Minute, Second, MilliSecond);
ResultLen := 0; ResultLen := 0;
@ -1110,7 +1110,7 @@ begin
if FormatStr <> '' then if FormatStr <> '' then
StoreFormat(FormatStr, 0, False) StoreFormat(FormatStr, 0, False)
else else
StoreFormat('C', 0, False); StoreFormat('C', 0, False);
ResultBuffer[ResultLen] := #0; ResultBuffer[ResultLen] := #0;
result := StrPas(@ResultBuffer[0]); result := StrPas(@ResultBuffer[0]);
end ; end ;
@ -1171,10 +1171,10 @@ end;
function TryStrToDate(const S: ShortString; out Value: TDateTime; function TryStrToDate(const S: ShortString; out Value: TDateTime;
const useformat : string; separator : char = #0): Boolean; const useformat : string; separator : char = #0): Boolean;
Var Var
Msg : Ansistring; Msg : Ansistring;
begin begin
Value:=IntStrToDate(Msg,@S[1],Length(S),useformat,defaultformatsettings,separator); Value:=IntStrToDate(Msg,@S[1],Length(S),useformat,defaultformatsettings,separator);
Result:=(Msg=''); Result:=(Msg='');
@ -1182,10 +1182,10 @@ end;
function TryStrToDate(const S: AnsiString; out Value: TDateTime; function TryStrToDate(const S: AnsiString; out Value: TDateTime;
const useformat : string; separator : char = #0): Boolean; const useformat : string; separator : char = #0): Boolean;
Var Var
Msg : Ansistring; Msg : Ansistring;
begin begin
Result:=Length(S)<>0; Result:=Length(S)<>0;
If Result then If Result then
@ -1209,13 +1209,13 @@ end;
function TryStrToDate(const S: AnsiString; out Value: TDateTime; separator : char): Boolean; function TryStrToDate(const S: AnsiString; out Value: TDateTime; separator : char): Boolean;
begin begin
Result:=TryStrToDate(S,Value,ShortDateFormat,Separator); Result:=TryStrToDate(S,Value,ShortDateFormat,Separator);
end; end;
function TryStrToDate(const S: string; out Value: TDateTime; const FormatSettings: TFormatSettings): Boolean; function TryStrToDate(const S: string; out Value: TDateTime; const FormatSettings: TFormatSettings): Boolean;
Var Var
Msg : Ansistring; Msg : Ansistring;
begin begin
Result:=Length(S)<>0; Result:=Length(S)<>0;
If Result then If Result then