The compatibility macros (that were introduced while moving bigarray file mapping functions to the Unix library) are no longer necessary, so let's get rid of them.
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
caml_unix_map_file and related functions were defined both in the stub lib for Unix and in the stub lib for Bigarray. This caused strange behavior when both Unix and Bigarray were linked, as found by the extra tests.
The extra tests (all two of them) check that Unix.map_file raises reasonable Unix_error exceptions in common error cases.
This is a follow-up to GPR #997 with a different implementation that creates fewer dependencies.
We add to the runtime a `byterun/bigarray.c` file that contains the bigarray creation functions that used to be in `otherlibs/bigarray/bigarray_stubs.c`. In the latter file we keep all primitives needed to implement the Bigarray interface. The functions in the new `byterun/bigarray.c` make it possible to create bigarrays both from the bigarray library and from the unix library.
The header file `bigarray.h` moves to `byterun/caml/bigarray.h` accordingly.
The `map_file` implementations move to `otherlibs/unix/mmap.c` and `otherlibs/win32unix/mmap.c`. Some bigarray allocation code shared between the two implementations is put in `otherlibs/unix/mmap_ba.c`.
Through a couple of `#ifdef`, the `map_file` implementations can also be compiled from within `otherlibs/bigarray` with the same semantics they had in 4.04.
As a consequence, the bigarray library still contains a standalone, Unix-independent implementation of `Bigarray.*.map_file`; the only difference with 4.04 is that it is marked deprecated.
Current status: compiled and lightly tested under Unix. Win32 implementation neither compiled nor tested.