* only return int64's from functions if it int64funcresok is defined

+ added int64funcresok define to options.pas
This commit is contained in:
Jonas Maebe 2000-12-15 13:26:01 +00:00
parent 7199d2f851
commit 0a70f9b06e
3 changed files with 35 additions and 7 deletions

View File

@ -116,7 +116,11 @@ interface
{ some helper routines } { some helper routines }
{$ifdef INT64FUNCRESOK}
function get_ordinal_value(p : tnode) : TConstExprInt; function get_ordinal_value(p : tnode) : TConstExprInt;
{$else INT64FUNCRESOK}
function get_ordinal_value(p : tnode) : longint;
{$endif INT64FUNCRESOK}
function is_constnode(p : tnode) : boolean; function is_constnode(p : tnode) : boolean;
function is_constintnode(p : tnode) : boolean; function is_constintnode(p : tnode) : boolean;
function is_constcharnode(p : tnode) : boolean; function is_constcharnode(p : tnode) : boolean;
@ -201,7 +205,11 @@ implementation
genpcharconstnode:=cstringconstnode.createpchar(s,length); genpcharconstnode:=cstringconstnode.createpchar(s,length);
end; end;
{$ifdef INT64FUNCRESOK}
function get_ordinal_value(p : tnode) : TConstExprInt; function get_ordinal_value(p : tnode) : TConstExprInt;
{$else INT64FUNCRESOK}
function get_ordinal_value(p : tnode) : longint;
{$endif INT64FUNCRESOK}
begin begin
if p.nodetype=ordconstn then if p.nodetype=ordconstn then
get_ordinal_value:=tordconstnode(p).value get_ordinal_value:=tordconstnode(p).value
@ -650,7 +658,11 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.12 2000-12-07 17:19:42 jonas Revision 1.13 2000-12-15 13:26:01 jonas
* only return int64's from functions if it int64funcresok is defined
+ added int64funcresok define to options.pas
Revision 1.12 2000/12/07 17:19:42 jonas
* new constant handling: from now on, hex constants >$7fffffff are * new constant handling: from now on, hex constants >$7fffffff are
parsed as unsigned constants (otherwise, $80000000 got sign extended parsed as unsigned constants (otherwise, $80000000 got sign extended
and became $ffffffff80000000), all constants in the longint range and became $ffffffff80000000), all constants in the longint range

View File

@ -1230,6 +1230,7 @@ begin
def_symbol('HASOUT'); def_symbol('HASOUT');
def_symbol('HASINTF'); def_symbol('HASINTF');
def_symbol('INTERNSETLENGTH'); def_symbol('INTERNSETLENGTH');
def_symbol('INT64FUNCRESOK');
{$ifdef SUPPORT_FIXED} {$ifdef SUPPORT_FIXED}
def_symbol('HASFIXED'); def_symbol('HASFIXED');
@ -1509,7 +1510,11 @@ end;
end. end.
{ {
$Log$ $Log$
Revision 1.19 2000-11-30 22:48:23 florian Revision 1.20 2000-12-15 13:26:01 jonas
* only return int64's from functions if it int64funcresok is defined
+ added int64funcresok define to options.pas
Revision 1.19 2000/11/30 22:48:23 florian
* opts386 renamed * opts386 renamed
Revision 1.18 2000/11/29 00:30:34 florian Revision 1.18 2000/11/29 00:30:34 florian

View File

@ -46,7 +46,11 @@ interface
procedure do_member_read(getaddr : boolean;const sym : psym;var p1 : tnode; procedure do_member_read(getaddr : boolean;const sym : psym;var p1 : tnode;
var pd : pdef;var again : boolean); var pd : pdef;var again : boolean);
{$ifdef int64funcresok}
function get_intconst:TConstExprInt; function get_intconst:TConstExprInt;
{$else int64funcresok}
function get_intconst:longint;
{$endif int64funcresok}
function get_stringconst:string; function get_stringconst:string;
@ -2367,8 +2371,11 @@ _LECKKLAMMER : begin
expr:=p1; expr:=p1;
end; end;
{$ifdef int64funcresok}
function get_intconst:TConstExprInt; function get_intconst:TConstExprInt;
{$else int64funcresok}
function get_intconst:longint;
{$endif int64funcresok}
{Reads an expression, tries to evalute it and check if it is an integer {Reads an expression, tries to evalute it and check if it is an integer
constant. Then the constant is returned.} constant. Then the constant is returned.}
var var
@ -2378,9 +2385,9 @@ _LECKKLAMMER : begin
do_firstpass(p); do_firstpass(p);
if not codegenerror then if not codegenerror then
begin begin
if (p.nodetype<>ordconstn) and if (p.nodetype<>ordconstn) or
(p.resulttype^.deftype=orddef) and (p.resulttype^.deftype<>orddef) or
not(Porddef(p.resulttype)^.typ in [uvoid,uchar,bool8bit,bool16bit,bool32bit]) then (Porddef(p.resulttype)^.typ in [uvoid,uchar,bool8bit,bool16bit,bool32bit]) then
Message(cg_e_illegal_expression) Message(cg_e_illegal_expression)
else else
get_intconst:=tordconstnode(p).value; get_intconst:=tordconstnode(p).value;
@ -2413,7 +2420,11 @@ _LECKKLAMMER : begin
end. end.
{ {
$Log$ $Log$
Revision 1.20 2000-12-15 12:13:52 michael Revision 1.21 2000-12-15 13:26:01 jonas
* only return int64's from functions if it int64funcresok is defined
+ added int64funcresok define to options.pas
Revision 1.20 2000/12/15 12:13:52 michael
+ Fix from Peter + Fix from Peter
Revision 1.19 2000/12/07 17:19:42 jonas Revision 1.19 2000/12/07 17:19:42 jonas