mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-24 03:42:35 +02:00
LCL: added AlignToPtr and AlignToInt to fpcadds
git-svn-id: trunk@32573 -
This commit is contained in:
parent
f18dadf725
commit
8dc1234b17
@ -119,7 +119,8 @@ interface
|
||||
|
||||
uses
|
||||
Classes, // TStrings in Split method
|
||||
SysUtils; // Exception
|
||||
SysUtils,
|
||||
FPCAdds; // Exception
|
||||
|
||||
type
|
||||
{$IFDEF UniCode}
|
||||
@ -687,24 +688,6 @@ const
|
||||
XIgnoredChars = [' ', #9, #$d, #$a];
|
||||
{$ENDIF}
|
||||
|
||||
function AlignToPtr(const p: Pointer): Pointer;
|
||||
begin
|
||||
{$IFDEF FPC_REQUIRES_PROPER_ALIGNMENT}
|
||||
Result := Align(p, SizeOf(Pointer));
|
||||
{$ELSE}
|
||||
Result := p;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
function AlignToInt(const p: Pointer): Pointer;
|
||||
begin
|
||||
{$IFDEF FPC_REQUIRES_PROPER_ALIGNMENT}
|
||||
Result := Align(p, SizeOf(integer));
|
||||
{$ELSE}
|
||||
Result := p;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
{=============================================================}
|
||||
{=================== WideString functions ====================}
|
||||
{=============================================================}
|
||||
|
||||
@ -1689,17 +1689,6 @@ end;
|
||||
|
||||
// -----------------------------------------------------------
|
||||
|
||||
function AlignToPtr(const p: Pointer): Pointer;
|
||||
begin
|
||||
{$IFDEF FPC_REQUIRES_PROPER_ALIGNMENT}
|
||||
Result := Align(p, SizeOf(Pointer));
|
||||
{$ELSE}
|
||||
Result := p;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
// -----------------------------------------------------------
|
||||
|
||||
procedure WritePublishedProperties(Instance: TPersistent);
|
||||
var
|
||||
TypeInfo: PTypeInfo;
|
||||
|
||||
@ -48,6 +48,9 @@ function CompareValue ( const A, B : Int64) : TValueRelationship; inline;
|
||||
{$ENDIF}
|
||||
function StrToWord(const s: string): word;
|
||||
|
||||
function AlignToPtr(const p: Pointer): Pointer;
|
||||
function AlignToInt(const p: Pointer): Pointer;
|
||||
|
||||
implementation
|
||||
|
||||
function StrToWord(const s: string): word;
|
||||
@ -62,6 +65,24 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function AlignToPtr(const p: Pointer): Pointer;
|
||||
begin
|
||||
{$IFDEF FPC_REQUIRES_PROPER_ALIGNMENT}
|
||||
Result := Align(p, SizeOf(Pointer));
|
||||
{$ELSE}
|
||||
Result := p;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
function AlignToInt(const p: Pointer): Pointer;
|
||||
begin
|
||||
{$IFDEF FPC_REQUIRES_PROPER_ALIGNMENT}
|
||||
Result := Align(p, SizeOf(integer));
|
||||
{$ELSE}
|
||||
Result := p;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
{$IFNDEF FPC_HAS_QWORDCOMPAREVALUE}
|
||||
function CompareValue (const A, B : QWord) : TValueRelationship;
|
||||
begin
|
||||
|
||||
Loading…
Reference in New Issue
Block a user