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 on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
It would be nice if Mono included a library (perhaps it could be part of Mono.Posix) that had a struct, implemented like so:
It would have no public members, but have comparison operators, addition, etc. like a normal number. It would have implicit cast operator to either IntPtr or long, and explicit to int and other number type.
Implement it backed by a 4-byte int, as far as the IL is concerned.
In other words, it would act like a number.
Now the special part is, MS.NET does not exist on any platforms where long is not 4 bytes.
So, this special struct could, on *Mono* platforms, be automatically replaced by a genuine integer that is the size of a C long, as far as marshaling is concerned and the whole works. This would let Mono resolve all long integer portability problems between Linux and Windows on the same code base. This is an extension Mono could do with no repercussions.
On top of that it'd get people including a Mono-controlled class library on portable programs even on Windows, which would spread the usage of Mono APIs.
This seems like something that should be prototyped elsewhere.