Closed gdraheim closed 6 years ago
Also check how MINGW chose to use the windows-native HANDLE int-type to capture the value.
https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-zziplib/mingw-mmap-workaround.patch
as the mmap-handle is almost always a kind of pointer-reference it may be best to use stdint's intptr_t
(wrapped as a zzip_intptr_t
) as the type of ->user
(and perhaps ->sys
).
Since the fd-map on unix-machines won't exceed even 32k in the majority of cases, that should be good enough even for very small machines where sizeof(intptr_t) == sizeof(short)
Actually, the MINGW code shows that we do not need to store the filemapping-handle at all.
That makes it even easier to keep binary backward compatibility.
=> please test.
done.
On WIN64 sizeof(long) < sizeof(*ptr), so the mmap-handle storage variable (->user/->sys) needs to be rechecked.
A patch exists at TexLive =>
https://www.tug.org/svn/texlive/trunk/Build/source/libs/zziplib/TLpatches/patch-02-bugfix