diff options
author | Alain Frisch <alain@frisch.fr> | 2013-06-18 10:25:01 +0000 |
---|---|---|
committer | Alain Frisch <alain@frisch.fr> | 2013-06-18 10:25:01 +0000 |
commit | 58e99bd087a837288e96f6f5d797cc0852669690 (patch) | |
tree | f4840cae591db71c9294caf914a8d38066c2fe86 /byterun/win32.c | |
parent | f59df29db43b6befe1a9f8248691c55f369402cf (diff) | |
download | ocaml-58e99bd087a837288e96f6f5d797cc0852669690.tar.gz |
#4719: use GetModuleFileName to get an absolute path to the current executable under Windows.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13799 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/win32.c')
-rw-r--r-- | byterun/win32.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/byterun/win32.c b/byterun/win32.c index d807f69003..5bb4fc1532 100644 --- a/byterun/win32.c +++ b/byterun/win32.c @@ -502,3 +502,16 @@ void caml_install_invalid_parameter_handler() } #endif + + +/* Recover executable name */ + +int caml_executable_name(char * name, int name_len) +{ + int retcode; + + int ret = GetModuleFileName(NULL, name, name_len); + printf("ret = %d, name = %s\n", ret, name); fflush(stdout); + if (0 == ret || ret >= name_len) return -1; + return 0; +} |