mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 12:29:14 +02:00
+ added helper function are_equal_ints()
git-svn-id: trunk@35761 -
This commit is contained in:
parent
e78f0aafcd
commit
876c0c5fd5
@ -259,6 +259,9 @@ interface
|
||||
{# Returns true, if def is a 64 bit type }
|
||||
function is_64bit(def : tdef) : boolean;
|
||||
|
||||
{ true, if def1 and def2 are both integers of the same bit size and sign }
|
||||
function are_equal_ints(def1, def2: tdef): boolean;
|
||||
|
||||
{ true, if def is an int type, larger than the processor's native int size }
|
||||
function is_oversizedint(def : tdef) : boolean;
|
||||
|
||||
@ -925,6 +928,16 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
{ true, if def1 and def2 are both integers of the same bit size and sign }
|
||||
function are_equal_ints(def1, def2: tdef): boolean;
|
||||
begin
|
||||
result:=(def1.typ=orddef) and (def2.typ=orddef) and
|
||||
(torddef(def1).ordtype in [u8bit,u16bit,u32bit,u64bit,
|
||||
s8bit,s16bit,s32bit,s64bit]) and
|
||||
(torddef(def1).ordtype=torddef(def2).ordtype);
|
||||
end;
|
||||
|
||||
|
||||
{ true, if def is an int type, larger than the processor's native int size }
|
||||
function is_oversizedint(def : tdef) : boolean;
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user