* Removed px_sdntogregorian for windows

git-svn-id: trunk@13896 -
This commit is contained in:
michael 2009-10-17 14:01:00 +00:00
parent 9f5c7c3344
commit 8fdf9dd80c
3 changed files with 16 additions and 6 deletions

View File

@ -124,7 +124,7 @@ type
function ParseType(Parent: TPasElement; Prefix : String): TPasType;overload;
function ParseType(Parent: TPasElement): TPasType;overload;
function ParseComplexType: TPasType;
function ParseComplexType(Parent : TPasElement = Nil): TPasType;
procedure ParseArrayType(Element: TPasArrayType);
procedure ParseFileType(Element: TPasFileType);
function ParseExpression: String;
@ -516,20 +516,20 @@ begin
end;
end;
function TPasParser.ParseComplexType: TPasType;
function TPasParser.ParseComplexType(Parent : TPasElement = Nil): TPasType;
begin
NextToken;
case CurToken of
tkProcedure:
begin
Result := TPasProcedureType(CreateElement(TPasProcedureType, '', nil));
Result := TPasProcedureType(CreateElement(TPasProcedureType, '', Parent));
ParseProcedureOrFunctionHeader(Result,
TPasProcedureType(Result), ptProcedure, True);
UngetToken; // Unget semicolon
end;
tkFunction:
begin
Result := Engine.CreateFunctionType('', 'Result', nil, False,
Result := Engine.CreateFunctionType('', 'Result', Parent, False,
Scanner.CurFilename, Scanner.CurRow);
ParseProcedureOrFunctionHeader(Result,
TPasFunctionType(Result), ptFunction, True);
@ -538,7 +538,7 @@ begin
else
begin
UngetToken;
Result := ParseType(nil);
Result := ParseType(Parent);
exit;
end;
end;
@ -1198,7 +1198,7 @@ begin
ExpectIdentifier;
end;
VarType := ParseComplexType;
VarType := ParseComplexType(Parent);
H:=CheckHint(Nil,False);
NextToken;

View File

@ -81,8 +81,12 @@ begin
pxfDate:
if PX_get_data_long(Doc,fbuf,flen,@longv)>0 then
begin
{$ifdef windows}
S:=DateToStr(Longv+1721425-2415019);
{$else}
PX_SdnToGregorian(longv+1721425,@Y,@M,@D);
S:=DateToStr(EncodeDate(Y,M,D));
{$endif}
end;
pxfShort:
if PX_get_data_short(Doc,fbuf, flen, @D)>0 then

View File

@ -369,7 +369,9 @@ var
PX_put_data_byte : procedure(pxdoc:Ppxdoc_t; data:pcchar; len:cint; value:cchar);cdecl;
PX_put_data_bcd : procedure(pxdoc:Ppxdoc_t; data:pcchar; len:cint; value:pcchar);cdecl;
PX_put_data_blob : function(pxdoc:Ppxdoc_t; data:pcchar; len:cint; value:pcchar; valuelen:cint):cint;cdecl;
{$ifndef windows}
PX_SdnToGregorian : procedure(sdn:clong; pYear:pcint; pMonth:pcint; pDay:pcint);cdecl;
{$endif}
PX_GregorianToSdn : function(year:cint; month:cint; day:cint):clong;cdecl;
PX_make_time : function(pxdoc:Ppxdoc_t; hour:cint; minute:cint; second:cint):Ppxval_t;cdecl;
PX_make_date : function(pxdoc:Ppxdoc_t; year:cint; month:cint; day:cint):Ppxval_t;cdecl;
@ -472,7 +474,9 @@ begin
PX_put_data_byte:=nil;
PX_put_data_bcd:=nil;
PX_put_data_blob:=nil;
{$ifndef windows}
PX_SdnToGregorian:=nil;
{$endif}
PX_GregorianToSdn:=nil;
PX_make_time:=nil;
PX_make_date:=nil;
@ -563,7 +567,9 @@ begin
pointer(PX_put_data_byte):=GetProcAddress(hlib,'PX_put_data_byte');
pointer(PX_put_data_bcd):=GetProcAddress(hlib,'PX_put_data_bcd');
pointer(PX_put_data_blob):=GetProcAddress(hlib,'PX_put_data_blob');
{$ifndef windows}
pointer(PX_SdnToGregorian):=GetProcAddress(hlib,'PX_SdnToGregorian');
{$endif windows}
pointer(PX_GregorianToSdn):=GetProcAddress(hlib,'PX_GregorianToSdn');
pointer(PX_make_time):=GetProcAddress(hlib,'PX_make_time');
pointer(PX_make_date):=GetProcAddress(hlib,'PX_make_date');