Size of types problems

Issue #281 resolved
Alex Egorov created an issue

LongWord type. I’m lost several days with debugging program under Linux. And when my problem was found I’m was confused.

LongWord is 4 bits length under Windows x86 and x64, but 8 bits under Linux x64.

But… with CrossVCL in my program used unit Winapi.Windows. In this unit LongWord reassigned: LongWord = type Cardinal.

With this unit LongWord have length 4 bit even under Linux x64!

Now I’m change all LongWord declarations to System.LongWord.

I think this should be described anywhere to avoid such mistakes.

And also now I don’t know which types I can use safely without issues with length of type

Comments (1)

  1. Eugene Kryukov repo owner

    Since CrossVcl simulate Windows behavior LongWord should be 4-bytes - like on Windows 64-bit to keep all API compatible.

  2. Log in to comment