<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 8/8/2015 12:30 AM, Sven Barth wrote:<br>
</div>
<blockquote
cite="mid:CAFMUeB-eJ3VxX+L-s9VYTGDbg19-DwYFU+F6VDQuu19UnTK3qA@mail.gmail.com"
type="cite">
<p>Am 08.08.2015 00:37 schrieb "Ralf Quint" <<a
moz-do-not-send="true" href="mailto:freedos.la@gmail.com"><a class="moz-txt-link-abbreviated" href="mailto:freedos.la@gmail.com">freedos.la@gmail.com</a></a>>:<br>
><br>
> On 8/6/2015 8:25 PM, Xiangrong Fang wrote:<br>
>><br>
>> It seems that $packrecord does not work at all. <br>
><br>
> I always explicitly use PACKED Record as in<br>
><br>
> Type ifmap = PACKED Record<br>
> mem_start: dword;<br>
> mem_end: dword;<br>
> base_addr: word;<br>
> irq: byte;<br>
> dma: byte;<br>
> port: byte;<br>
> end;<br>
><br>
> and at least in/up to FPC 2.6.4, this works for me just
fine</p>
<p>This depends however on the code you're interfacing with. Also
the record you mentioned as an example shouldn't differ with and
without packed anyway...</p>
<br>
</blockquote>
I just copied and pasted the code snippet from the OP, to show how
to use the PACKED Record statement explicitly for a specific record.
I am using this for cross-platform/cross-compiler/cross-language
software for at least 30 years now and probably for +20 years in
FreePascal (when it was still called FPK and was an attempt of
creating a 32bit compiler compatible with 16bit Turbo/Borland Pascal
at that time)...<br>
<br>
Beside, on the above record, the layout in fact SHOULD matter as it
has 3 single bytes at the end and there for needs to be aligned on
the byte, not on any word/dword/etc boundary...<br>
<br>
Ralf<br>
<br>
Ralf<br>
<br>
<br /><br />
<hr style='border:none; color:#909090; background-color:#B0B0B0; height: 1px; width: 99%;' />
<table style='border-collapse:collapse;border:none;'>
<tr>
<td style='border:none;padding:0px 15px 0px 8px'>
<a href="https://www.avast.com/antivirus">
<img border=0 src="http://static.avast.com/emails/avast-mail-stamp.png" alt="Avast logo" />
</a>
</td>
<td>
<p style='color:#3d4d5a; font-family:"Calibri","Verdana","Arial","Helvetica"; font-size:12pt;'>
This email has been checked for viruses by Avast antivirus software.
<br><a href="https://www.avast.com/antivirus">www.avast.com</a>
</p>
</td>
</tr>
</table>
<br />
</body>
</html>