2016-02-18 07:11:59 -08:00
|
|
|
/**************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* OCaml */
|
|
|
|
/* */
|
|
|
|
/* Manuel Serrano and Xavier Leroy, INRIA Rocquencourt */
|
|
|
|
/* */
|
|
|
|
/* Copyright 2000 Institut National de Recherche en Informatique et */
|
|
|
|
/* en Automatique. */
|
|
|
|
/* */
|
|
|
|
/* All rights reserved. This file is distributed under the terms of */
|
|
|
|
/* the GNU Lesser General Public License version 2.1, with the */
|
|
|
|
/* special exception on linking described in the file LICENSE. */
|
|
|
|
/* */
|
|
|
|
/**************************************************************************/
|
2000-03-16 05:35:20 -08:00
|
|
|
|
2017-03-03 07:49:24 -08:00
|
|
|
#define CAML_INTERNALS
|
|
|
|
|
2000-03-16 05:35:20 -08:00
|
|
|
#include <stddef.h>
|
2017-03-19 02:21:49 -07:00
|
|
|
#include "caml/alloc.h"
|
2017-03-03 07:03:28 -08:00
|
|
|
#include "caml/bigarray.h"
|
2014-12-27 06:41:49 -08:00
|
|
|
#include "caml/fail.h"
|
2017-03-03 07:03:28 -08:00
|
|
|
#include "caml/io.h"
|
2014-12-27 06:41:49 -08:00
|
|
|
#include "caml/mlvalues.h"
|
2017-03-03 07:03:28 -08:00
|
|
|
#include "caml/signals.h"
|
2014-12-27 06:41:49 -08:00
|
|
|
#include "caml/sys.h"
|
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 08:41:29 -07:00
|
|
|
#include "caml/osdeps.h"
|
2000-03-16 05:35:20 -08:00
|
|
|
#include "unixsupport.h"
|
|
|
|
|
2019-03-13 03:51:02 -07:00
|
|
|
#define uerror(func, arg) \
|
|
|
|
do { win32_maperr(GetLastError()); uerror(func, arg); } while(0)
|
2000-03-16 05:35:20 -08:00
|
|
|
|
2017-03-04 05:43:13 -08:00
|
|
|
/* Defined in [mmap_ba.c] */
|
2020-09-10 05:55:38 -07:00
|
|
|
extern value caml_unix_mapped_alloc(int, int, void *, intnat *);
|
2017-03-04 05:43:13 -08:00
|
|
|
|
2006-10-01 08:40:28 -07:00
|
|
|
#ifndef INVALID_SET_FILE_POINTER
|
|
|
|
#define INVALID_SET_FILE_POINTER (-1)
|
|
|
|
#endif
|
|
|
|
|
2017-03-03 07:03:28 -08:00
|
|
|
static __int64 caml_set_file_pointer(HANDLE h, __int64 dist, DWORD mode)
|
2006-06-10 07:15:43 -07:00
|
|
|
{
|
|
|
|
LARGE_INTEGER i;
|
|
|
|
DWORD err;
|
|
|
|
|
|
|
|
i.QuadPart = dist;
|
|
|
|
i.LowPart = SetFilePointer(h, i.LowPart, &i.HighPart, mode);
|
|
|
|
if (i.LowPart == INVALID_SET_FILE_POINTER) return -1;
|
|
|
|
return i.QuadPart;
|
|
|
|
}
|
|
|
|
|
2019-03-13 03:51:02 -07:00
|
|
|
CAMLprim value caml_unix_map_file(value vfd, value vkind, value vlayout,
|
|
|
|
value vshared, value vdim, value vstart)
|
2000-03-16 05:35:20 -08:00
|
|
|
{
|
|
|
|
HANDLE fd, fmap;
|
|
|
|
int flags, major_dim, mode, perm;
|
2005-09-22 07:21:50 -07:00
|
|
|
intnat num_dims, i;
|
2008-01-15 06:55:15 -08:00
|
|
|
intnat dim[CAML_BA_MAX_NUM_DIMS];
|
2006-06-10 07:15:43 -07:00
|
|
|
__int64 currpos, startpos, file_size, data_size;
|
|
|
|
uintnat array_size, page, delta;
|
2000-03-16 05:35:20 -08:00
|
|
|
char c;
|
|
|
|
void * addr;
|
2006-06-10 07:15:43 -07:00
|
|
|
LARGE_INTEGER li;
|
|
|
|
SYSTEM_INFO sysinfo;
|
2000-03-16 05:35:20 -08:00
|
|
|
|
|
|
|
fd = Handle_val(vfd);
|
2014-01-09 08:24:30 -08:00
|
|
|
flags = Caml_ba_kind_val(vkind) | Caml_ba_layout_val(vlayout);
|
2006-06-10 07:15:43 -07:00
|
|
|
startpos = Int64_val(vstart);
|
2000-03-16 05:35:20 -08:00
|
|
|
num_dims = Wosize_val(vdim);
|
2008-01-15 06:55:15 -08:00
|
|
|
major_dim = flags & CAML_BA_FORTRAN_LAYOUT ? num_dims - 1 : 0;
|
2012-02-10 08:15:24 -08:00
|
|
|
/* Extract dimensions from OCaml array */
|
2000-03-16 05:35:20 -08:00
|
|
|
num_dims = Wosize_val(vdim);
|
2008-01-15 06:55:15 -08:00
|
|
|
if (num_dims < 1 || num_dims > CAML_BA_MAX_NUM_DIMS)
|
2019-03-13 03:51:02 -07:00
|
|
|
caml_invalid_argument("Unix.map_file: bad number of dimensions");
|
2000-03-16 05:35:20 -08:00
|
|
|
for (i = 0; i < num_dims; i++) {
|
|
|
|
dim[i] = Long_val(Field(vdim, i));
|
|
|
|
if (dim[i] == -1 && i == major_dim) continue;
|
2008-01-04 07:01:48 -08:00
|
|
|
if (dim[i] < 0)
|
2019-03-13 03:51:02 -07:00
|
|
|
caml_invalid_argument("Unix.map_file: negative dimension");
|
2000-03-16 05:35:20 -08:00
|
|
|
}
|
|
|
|
/* Determine file size */
|
2017-03-03 07:03:28 -08:00
|
|
|
currpos = caml_set_file_pointer(fd, 0, FILE_CURRENT);
|
2019-03-13 03:51:02 -07:00
|
|
|
if (currpos == -1) uerror("map_file", Nothing);
|
2017-03-03 07:03:28 -08:00
|
|
|
file_size = caml_set_file_pointer(fd, 0, FILE_END);
|
2019-03-13 03:51:02 -07:00
|
|
|
if (file_size == -1) uerror("map_file", Nothing);
|
2000-03-16 05:35:20 -08:00
|
|
|
/* Determine array size in bytes (or size of array without the major
|
|
|
|
dimension if that dimension wasn't specified) */
|
2008-01-15 06:55:15 -08:00
|
|
|
array_size = caml_ba_element_size[flags & CAML_BA_KIND_MASK];
|
2000-03-16 05:35:20 -08:00
|
|
|
for (i = 0; i < num_dims; i++)
|
|
|
|
if (dim[i] != -1) array_size *= dim[i];
|
|
|
|
/* Check if the first/last dimension is unknown */
|
|
|
|
if (dim[major_dim] == -1) {
|
|
|
|
/* Determine first/last dimension from file size */
|
2006-06-10 07:15:43 -07:00
|
|
|
if (file_size < startpos)
|
2019-03-13 03:51:02 -07:00
|
|
|
caml_failwith("Unix.map_file: file position exceeds file size");
|
2006-06-10 07:15:43 -07:00
|
|
|
data_size = file_size - startpos;
|
|
|
|
dim[major_dim] = (uintnat) (data_size / array_size);
|
|
|
|
array_size = dim[major_dim] * array_size;
|
|
|
|
if (array_size != data_size)
|
2019-03-13 03:51:02 -07:00
|
|
|
caml_failwith("Unix.map_file: file size doesn't match array dimensions");
|
2000-03-16 05:35:20 -08:00
|
|
|
}
|
|
|
|
/* Restore original file position */
|
2017-03-03 07:03:28 -08:00
|
|
|
caml_set_file_pointer(fd, currpos, FILE_BEGIN);
|
2000-03-16 05:35:20 -08:00
|
|
|
/* Create the file mapping */
|
|
|
|
if (Bool_val(vshared)) {
|
|
|
|
perm = PAGE_READWRITE;
|
|
|
|
mode = FILE_MAP_WRITE;
|
|
|
|
} else {
|
|
|
|
perm = PAGE_READONLY; /* doesn't work under Win98 */
|
|
|
|
mode = FILE_MAP_COPY;
|
|
|
|
}
|
2006-06-10 07:15:43 -07:00
|
|
|
li.QuadPart = startpos + array_size;
|
|
|
|
fmap = CreateFileMapping(fd, NULL, perm, li.HighPart, li.LowPart, NULL);
|
2019-03-13 03:51:02 -07:00
|
|
|
if (fmap == NULL) uerror("map_file", Nothing);
|
2006-06-10 07:15:43 -07:00
|
|
|
/* Determine offset so that the mapping starts at the given file pos */
|
|
|
|
GetSystemInfo(&sysinfo);
|
2011-07-20 02:17:07 -07:00
|
|
|
delta = (uintnat) (startpos % sysinfo.dwAllocationGranularity);
|
2000-03-16 05:35:20 -08:00
|
|
|
/* Map the mapping in memory */
|
2006-06-10 07:15:43 -07:00
|
|
|
li.QuadPart = startpos - delta;
|
2010-01-22 04:48:24 -08:00
|
|
|
addr =
|
2006-06-10 07:15:43 -07:00
|
|
|
MapViewOfFile(fmap, mode, li.HighPart, li.LowPart, array_size + delta);
|
2019-03-13 03:51:02 -07:00
|
|
|
if (addr == NULL) uerror("map_file", Nothing);
|
2006-06-10 07:15:43 -07:00
|
|
|
addr = (void *) ((uintnat) addr + delta);
|
2000-03-16 05:35:20 -08:00
|
|
|
/* Close the file mapping */
|
|
|
|
CloseHandle(fmap);
|
2012-02-10 08:15:24 -08:00
|
|
|
/* Build and return the OCaml bigarray */
|
2019-03-13 03:51:02 -07:00
|
|
|
return caml_unix_mapped_alloc(flags, num_dims, addr, dim);
|
2000-03-16 05:35:20 -08:00
|
|
|
}
|
|
|
|
|
2019-03-13 03:51:02 -07:00
|
|
|
CAMLprim value caml_unix_map_file_bytecode(value * argv, int argn)
|
2006-06-10 07:15:43 -07:00
|
|
|
{
|
2019-03-13 03:51:02 -07:00
|
|
|
return caml_unix_map_file(argv[0], argv[1], argv[2],
|
|
|
|
argv[3], argv[4], argv[5]);
|
2006-06-10 07:15:43 -07:00
|
|
|
}
|
|
|
|
|
2019-03-13 03:51:02 -07:00
|
|
|
void caml_ba_unmap_file(void * addr, uintnat len)
|
2000-03-16 05:35:20 -08:00
|
|
|
{
|
2006-06-10 07:15:43 -07:00
|
|
|
SYSTEM_INFO sysinfo;
|
|
|
|
uintnat delta;
|
|
|
|
|
|
|
|
GetSystemInfo(&sysinfo);
|
2011-07-20 02:17:07 -07:00
|
|
|
delta = (uintnat) addr % sysinfo.dwAllocationGranularity;
|
2006-06-10 07:15:43 -07:00
|
|
|
UnmapViewOfFile((void *)((uintnat)addr - delta));
|
2000-03-16 05:35:20 -08:00
|
|
|
}
|
2017-03-03 11:14:00 -08:00
|
|
|
|
|
|
|
#ifdef IN_OCAML_BIGARRAY
|
|
|
|
|
|
|
|
/* This function reports a Win32 error as a Sys_error exception.
|
|
|
|
It is included for backward compatibility with the old
|
|
|
|
Bigarray.*.map_file implementation. */
|
|
|
|
|
|
|
|
static void caml_ba_sys_error(void)
|
|
|
|
{
|
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 08:41:29 -07:00
|
|
|
wchar_t buffer[512];
|
2017-03-03 11:14:00 -08:00
|
|
|
DWORD errnum;
|
|
|
|
|
|
|
|
errnum = GetLastError();
|
|
|
|
if (!FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
|
|
|
|
NULL,
|
|
|
|
errnum,
|
|
|
|
0,
|
|
|
|
buffer,
|
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 08:41:29 -07:00
|
|
|
sizeof(buffer)/sizeof(wchar_t),
|
2017-03-03 11:14:00 -08:00
|
|
|
NULL))
|
2017-08-12 13:24:41 -07:00
|
|
|
swprintf(buffer, sizeof(buffer)/sizeof(wchar_t),
|
|
|
|
L"Unknown error %ld\n", errnum);
|
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 08:41:29 -07:00
|
|
|
caml_raise_sys_error(caml_copy_string_of_utf16(buffer));
|
2017-03-03 11:14:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|