Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 361 on
GitHub or Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
The minizip API exposes 'long' and 'ulong' types which are not fixed width. Therefore it's impossible to bind and P/Invoke these in a cross platform way. Currently we only work on systems where sizeof (IntPtr) == sizeof (native long).
First: Should we fix this?
- Yes, ideally we should. If we don't fix it, maybe there should be a compile time make check to ensure sizeof (native long) == sizeof (native pointer).
Second: How should we fix it
- We can expose a nicer API which uses fixed width types.
- Or we can modify the existing minizip APIs to expose only fixed width sizes
The former is the least invasive but would make it confusing for people P/Invoking the native libs as there'd be two sets of APIs to choose from.
The latter would be better as there'd be a single set of working APIs which can be P/Invoked. However if we wanted to import a newer minizip we'd have a maintenance burden porting the changes to the newer minizip. Also we'd have to port every single usage of minizip in one go if we wanted to go with this approach. If it's P/Invoked elsewhere it'd just blow up as the existing P/Invoke declarations would no longer be compatible.
I suggest that we force uLong (the only long I could find on the API) to be 32bits on 64 bit systems.
It seems that the code in minizip assumes that uLong is actually 32 bits in a few places.