64-bit is the problem now. Pascal and C have different default sizes for integer types. C always uses the native register size, Pascal uses max 32 bits for Integer and Cardinal.
Solution: use PtrInt and PtrUInt instead. They match with C types.
There may be other potential problems with 64-bit. I only know this one.
Juha