[fpc-pascal] Problem compiling DLL for 64Bit Windows - complete example attached

Reimar Grabowski reimgrab at web.de
Fri Dec 18 14:58:10 CET 2009


On Fri, 18 Dec 2009 13:39:45 +0100
Lukas Gradl <fpc at ssn.at> wrote:

> I'm not shure about that as I'm not that good at C. The packed record 
> works at 32bit -so I thought that should be correct.
If it works on 32bit it should be correct.

> Is there a difference between 64Bit and 32Bit?
Yes.
Some types have different sizes and even the alignment is different for some types.
For details look here: http://www.x86-64.org/documentation.html
 
> Here is the orginal C definition, could someone take a look at this:
I cannot help you directly but I can give you a hint based on my experience with C-headers on 64-bit.
First you should check what types these typedefs like DWORD actually are. After that you can use the corresponding type from the ctypes unit of FPC. This is the easiest way I found to make my C-headers work correctly on 64-bit as types defined in this unit have the correct sizes and alignments.
For example DWORD is actually unsigned long, AFAIK. This would be culong in the ctypes unit.

hope it helps
R.
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?



More information about the fpc-pascal mailing list