Commit Graph

13 Commits (c3f6cd7ff7d53a1b97651ad59d2c0c81f98751a8)

Author SHA1 Message Date
David Allsopp 83f0dda553 Don't use CAMLextern in C files 2020-09-10 13:55:38 +01:00
Jérémie Dimino 9387160a21 Delete old compatibility from the bigarray stubs (#2315)
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>
2019-03-13 11:51:02 +01:00
David Allsopp b5d1929e87 Whitespace and overlong line fixes. 2018-06-14 15:15:34 +01:00
Nicolás Ojeda Bär 9fe6d0e2c2 Unicode support for the Windows runtime (#1200)
* Add support code

* Explicitly reference ANSI Windows APIs

* Adapt Sys.is_directory

* Adapt ocamlrun

* Add Changes entry

* Add testsuite

* Adapt Unix.open_process{_in,_out,_full,}, Unix.create_process{_env,}

* Adapt headernt.c

* Adapt Pervasives.open_{in,out}, Filename.temp_file, etc.

* Adapt Sys.file_exists

* Adapt Sys.remove

* Adapt Sys.chdir

* Adapt Sys.getcwd

* Adapt Sys.getenv

* Adapt Sys.command

* Adapt Sys.readdir

* Adapt CPLUGINS

* Remove use of FormatMessageA, CreateFileA

* Adapt Unix.mkdir

* Adapt Unix.openfile

* Adapt Unix.readlink

* Adapt Unix.rename

* Adapt Unix.{LargeFile,}.{l,}stat

* Adapt Unix.system

* Adapt Unix.{open,read}dir

* Adapt Unix.link

* Adapt Unix.symlink

* Adapt Unix.getcwd

* Adapt Unix.rmdir

* Adapt Unix.utimes

* Adapt Unix.unlink

* Adapt Unix.chdir

* Adapt Unix.chmod

* Adapt Unix.{execv,execve,execvp,execvpe}

* Compile with -DUNICODE -D_UNICODE under Windows

* Add configure-time switch, Config.windows_unicode

* Adapt Unix.putenv

* Re-implement Unix.environment using GetEnvironmentStrings()

* Use Unicode-aware flexdll

* Adapt Unix.environment

* AppVeyor: bootstrap flexdll

* Adapt tests/embedded/cmmain.c

* Adapt tests/lib-dynlink-csharp/entry.c

* Remove exec tests

* Fixup

* Pass -municode to MinGW compiler

* Try to fix tests/embedded

* Adapt Sys.rename

* Correct Changes entry

* Makefile.several: use $(O) and $(NATIVECODE_ONLY)

* Display => skipped correctly for tests/win-unicode

* Add missing casts to execv* calls

It's not clear why these aren't necessary for with char, but they are
necessary with wchar_t on GCC (but not MSVC).

* Missing header in systhreads (Win32 only)

* Revert "Pass -municode to MinGW compiler"

This reverts commit a4ce7fb319c429068a5b9d1ab14a2cc3969c355f.

* Revert "Try to fix tests/embedded"

This reverts commit 5197d8922295b7b339b970ec3189374aa15de4b8.

* Revert "Remove exec tests"

This reverts commit 306ccef2e79eca5b38ecfa285b912c7bcf3e9f52.

* Don't pass $(LDFLAGS) when build ocamlc.opt

It's already included via CC anyway, and it causes Unicode problems for
Winodws (because the linker options need to be prefixed "-link" to go via
flexlink).

* Use wmain on Windows for ocamlrun

* Build Unicode applications on Windows

* Use wmain in headernt.c

* Minor correction to win-unicode Makefile

* Switch submodule to FlexDLL 0.36

* Build ocamlyacc as an ANSI application

* Revert "Fixup"

This reverts commit 500bd6b575ffd6c5b71c6953e55d740f0b090185.

* Fix casts for execvp/execve

* Remove tabs from test code

* Fix Changes entry

* shell32.lib is no longer necessary

* Free allocated string

* Changes: signal breaking change

* Disable exec_tests

* Protect with CAML_INTERNALS
2017-09-18 17:41:29 +02:00
Sébastien Hinderer a6d7705369 Fix otherlibs/win32unix/mmap.c
This file should also include caml/alloc.h because it uses caml_copy_string
which this header defines.

This commit is a follow-up to PR#1077.
2017-03-19 10:21:49 +01:00
Sébastien Hinderer a01cfa2b5a Fix name clash in otherlibs/{,win32}unix/mmap.c
The MAP_FILE macro has been renamed to CAML_MAP_FILE to avoid conflict
with MAP_FILE's definition in sys/mman.h.
2017-03-14 08:34:59 +01:00
Xavier Leroy a5795f0264 Missing declaration of caml_ba_sys_error()
Follow-up to e763c83
2017-03-13 19:15:10 +01:00
Xavier Leroy d0ca012920 Wrong error reporting in the IN_OCAML_BIGARRAY legacy case 2017-03-13 19:15:10 +01:00
Xavier Leroy fdc2805f68 Unix.map_file: fix error reporting in the win32 implementation
Also: cosmetic improvement to corresponding test.
2017-03-13 19:15:10 +01:00
Xavier Leroy 4a48761b0f map_file: fix a C name clash and add more tests
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.
2017-03-13 19:15:10 +01:00
Xavier Leroy 2c2d5f706f win32unix/mmap.c: error reporting was all wrong, attempting a fix 2017-03-13 19:15:10 +01:00
Xavier Leroy fc5ed428d0 Define CAML_INTERNALS to see more of caml/bigarray.h 2017-03-13 19:15:10 +01:00
Xavier Leroy a9e4c54b75 Deprecation of Bigarray.*.map_file and introduction of Unix.map_file, continued
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.
2017-03-13 19:15:10 +01:00