Re: define_c_func/proc and 64-bit return types
- Posted by petelomax Aug 01, 2012
- 1286 views
In 4.1, C_LONGLONG is set to #03000002
That is a 16-bit float, if you remember such things.
[Assuming you are being totally explicit with your types], a signed 64 bit int should be #01000008 and an unsigned 64 bit int should be #02000008
Several things needed to be changed. In particular, things like C_INT and C_LONG were treated the same way in 4.0, which is a valid assumption for a 32-bit OS, but not for 64-bits.
Just to nitpick, it is the 64-bit application, not the 64-bit OS it must run on, that makes such assumptions invalid.
As far as Ansi/Unicode versions of dll routines go, don't we just leave that up to the programmer? Should 64-bit really be any different?
As you say, 32-bit apps need to be able to throw 64-bit ints around, so I would add explicit C_I32, C_I64, C_UI32, C_UI64, etc as well as changing C_INT from #01000004 on 32-bit to #01000008 on 64-bit. I would also say a 64-bit compiler should generate 64-bit apps; if you want to generate 32-bit apps on a 64-bit box then you should (also) install the 32-bit compiler. If the source has to differ, so be it.
Pete