diff --git a/rtl/inc/generic.inc b/rtl/inc/generic.inc index 233e97b940..621e364801 100644 --- a/rtl/inc/generic.inc +++ b/rtl/inc/generic.inc @@ -124,8 +124,9 @@ begin begin v:=(value shl 8) or value; v:=(v shl 16) or v; - if sizeof(ptruint)=8 then - v:=(v shl 32) or v; +{$ifdef CPU64} + v:=(v shl 32) or v; +{$endif CPU64} { Align on native pointer size } pend:=pbyte(align(pdest,sizeof(PtrUInt))); dec(count,pend-pdest); @@ -241,6 +242,24 @@ end; {$endif FPC_SYSTEM_HAS_FILLDWORD} +{$ifndef FPC_SYSTEM_HAS_FILLQWORD} +procedure fillqword(var x;count : SizeInt;value : qword); +var + pdest,pend : pqword; +begin + if count <= 0 then + exit; + pdest:=@x; + pend:=pdest+count; + while pdest high(PtrInt) div 4) or + (psrc+len < psrc) then + pend:=pqword(high(PtrUInt)-sizeof(qword)) + else + pend:=psrc+len; +{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT} + if (ptruint(psrc) mod 8)<>0 then + while psrc