fix several problems with tests/lib-dynlink-csharp on MSVC

master
Damien Doligez 2016-02-23 16:45:36 +01:00
parent 7543d73d83
commit 5a454ff204
5 changed files with 15 additions and 15 deletions

View File

@ -16,8 +16,9 @@
BASEDIR=../..
CSC=csc
COMPFLAGS=-I $(OTOPDIR)/otherlibs/bigarray
LD_PATH=$(TOPDIR)/otherlibs/bigarray
COMPFLAGS=-I $(OTOPDIR)/otherlibs/bigarray -I $(OTOPDIR)/otherlibs/dynlink \
-I $(OTOPDIR)/byterun
LD_PATH=$(TOPDIR)/otherlibs/bigarray:$(TOPDIR)/otherlibs/dynlink
default:
@$(SET_LD_PATH) $(MAKE) all
@ -40,7 +41,7 @@ bytecode:
echo " => skipped"; \
else \
$(OCAMLC) -output-obj -o main.dll dynlink.cma main.ml entry.c; \
$(CSC) /out:main.exe main.cs; \
$(CSC) /nologo /nowarn:1668 /out:main.exe main.cs; \
./main.exe > bytecode.result; \
$(DIFF) bytecode.reference bytecode.result >/dev/null \
&& echo " => passed" || echo " => failed"; \
@ -55,10 +56,10 @@ bytecode-dll:
else \
$(OCAMLC) -output-obj -o main_obj.$(O) dynlink.cma entry.c main.ml; \
$(MKDLL) -maindll -o main.dll main_obj.$(O) entry.$(O) \
../../byterun/libcamlrun.$(A) $(BYTECCLIBS) -v; \
$(CSC) /out:main.exe main.cs; \
./main.exe >bytecode.result; \
$(DIFF) bytecode.reference bytecode.result >/dev/null \
$(CTOPDIR)/byterun/libcamlrun.$(A) $(BYTECCLIBS); \
$(CSC) /nologo /nowarn:1668 /out:main.exe main.cs; \
./main.exe >bytecode-dll.result; \
$(DIFF) bytecode.reference bytecode-dll.result >/dev/null \
&& echo " => passed" || echo " => failed"; \
fi
@ -70,7 +71,7 @@ native:
echo " => skipped"; \
else \
$(OCAMLOPT) -output-obj -o main.dll dynlink.cmxa entry.c main.ml; \
$(CSC) /out:main.exe main.cs; \
$(CSC) /nologo /nowarn:1668 /out:main.exe main.cs; \
./main.exe > native.result; \
$(DIFF) native.reference native.result > /dev/null \
&& echo " => passed" || echo " => failed"; \
@ -86,10 +87,10 @@ native-dll:
$(OCAMLOPT) -output-obj -o main_obj.$(O) dynlink.cmxa entry.c \
main.ml; \
$(MKDLL) -maindll -o main.dll main_obj.$(O) entry.$(O) \
../../asmrun/libasmrun.lib -v; \
$(CSC) /out:main.exe main.cs; \
./main.exe > native.result; \
$(DIFF) native.reference native.result >/dev/null \
$(CTOPDIR)/asmrun/libasmrun.lib -v; \
$(CSC) /nologo /nowarn:1668 /out:main.exe main.cs; \
./main.exe > native-dll.result; \
$(DIFF) native.reference native-dll.result >/dev/null \
&& echo " => passed" || echo " => failed"; \
fi

View File

@ -1,7 +1,6 @@
Now starting the OCaml engine.
Main is running.
Loading ../../../otherlibs/bigarray/bigarray.cma
I'm the plugin.
Loading plugin.cmo
I'm the plugin.
OK.

View File

@ -20,7 +20,7 @@
#include <caml/custom.h>
#include <caml/fail.h>
#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
#if !defined(OPENSTEP) && (defined(_WIN32) && !defined(__CYGWIN__))
# if defined(_MSC_VER) || defined(__MINGW32__)
# define _DLLAPI __declspec(dllexport)
# else

View File

@ -21,6 +21,7 @@ let load s =
print_endline (Dynlink.error_message e)
let () =
ignore (Hashtbl.hash 42.0);
print_endline "Main is running.";
Dynlink.init ();
Dynlink.allow_unsafe_modules true;

View File

@ -1,7 +1,6 @@
Now starting the OCaml engine.
Main is running.
Loading ../../../otherlibs/bigarray/bigarray.cmxs
I'm the plugin.
Loading plugin.cmxs
I'm the plugin.
OK.