Menu

#674 Pd doesn't support Win64 pointers in GUI

open
nobody
None
5
2011-03-31
2011-03-31
Anonymous
No

Pd's GUI internals and GUI externals all do something wrong on Win64, where 64-bit pointers get cast to long, which is 32-bit, thus the pointers get truncated (aka ambiguous). This is not easily fixable in current circumstances because it means changing it not only all over Pd's source but also over the source of all externals, and they all have to be agreeing on this, to be binary-compatible. A fix might replace "%lx" by "%llx" all over pd's source but only in Win64's case. Nonstandard "%zx" (with a size_t cast) and "%tx" (with a ptrdiff_t cast) are more portable than that (as long as using glibc) because then they will do the correct thing without #ifdef.

Another more interesting fix is to get rid of having to use sys_vgui, for example by using a wrapper around sys_vgui where this kind of business would be centralised. (see desiredata's sys_mgui for one example).

Discussion

Anonymous
Anonymous

Add attachments
Cancel