summaryrefslogtreecommitdiffstats
path: root/testsuite/tests
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2013-05-17 15:06:37 +0000
committerDamien Doligez <damien.doligez-inria.fr>2013-05-17 15:06:37 +0000
commit2c6d524259bb1b14b1e70570778126fc2001d825 (patch)
treea999d109d1a7b738889705bd7b18ab407c9a5c40 /testsuite/tests
parent9bbd8bdaec6070a9f71f290b774e5dfe697bd9f0 (diff)
PR#5710: add Mono support to the testsuite
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13694 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/lib-dynlink-csharp/Makefile10
-rwxr-xr-xtestsuite/tests/lib-dynlink-csharp/entry.c18
2 files changed, 22 insertions, 6 deletions
diff --git a/testsuite/tests/lib-dynlink-csharp/Makefile b/testsuite/tests/lib-dynlink-csharp/Makefile
index fa5c2024a..17eeea436 100644
--- a/testsuite/tests/lib-dynlink-csharp/Makefile
+++ b/testsuite/tests/lib-dynlink-csharp/Makefile
@@ -34,7 +34,7 @@ prepare:
bytecode:
@printf " ... testing 'bytecode':"
@if [ ! `which $(CSC) >/dev/null 2>&1` ]; then \
- echo " => passed"; \
+ echo " => skipped"; \
else \
$(OCAMLC) -output-obj -o main.dll dynlink.cma main.ml entry.c; \
$(CSC) /out:main.exe main.cs; \
@@ -47,7 +47,7 @@ bytecode:
bytecode-dll:
@printf " ... testing 'bytecode-dll':"
@if [ ! `which $(CSC) > /dev/null 2>&1` ]; then \
- echo " => passed"; \
+ echo " => skipped"; \
else \
$(OCAMLC) -output-obj -o main_obj.$(O) dynlink.cma entry.c main.ml; \
$(MKDLL) -maindll -o main.dll main_obj.$(O) entry.$(O) \
@@ -62,7 +62,7 @@ bytecode-dll:
native:
@printf " ... testing 'native':"
@if [ ! `which $(CSC) > /dev/null 2>&1` ]; then \
- echo " => passed"; \
+ echo " => skipped"; \
else \
$(OCAMLOPT) -output-obj -o main.dll dynlink.cmxa entry.c main.ml; \
$(CSC) /out:main.exe main.cs; \
@@ -75,7 +75,7 @@ native:
native-dll:
@printf " ... testing 'native-dll':"
@if [ ! `which $(CSC) > /dev/null 2>&1` ]; then \
- echo " => passed"; \
+ echo " => skipped"; \
else \
$(OCAMLOPT) -output-obj -o main_obj.$(O) dynlink.cmxa entry.c \
main.ml; \
@@ -92,6 +92,6 @@ promote: defaultpromote
.PHONY: clean
clean: defaultclean
- @rm -f *.result *.exe *.dll
+ @rm -f *.result *.exe *.dll *.so *.obj *.o
include $(BASEDIR)/makefiles/Makefile.common
diff --git a/testsuite/tests/lib-dynlink-csharp/entry.c b/testsuite/tests/lib-dynlink-csharp/entry.c
index e3adebb83..a82eb46f6 100755
--- a/testsuite/tests/lib-dynlink-csharp/entry.c
+++ b/testsuite/tests/lib-dynlink-csharp/entry.c
@@ -17,7 +17,23 @@
#include <caml/custom.h>
#include <caml/fail.h>
-__declspec(dllexport) void __stdcall start_caml_engine() {
+#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
+# if defined(_MSC_VER) || defined(__MINGW32__)
+# define _DLLAPI __declspec(dllexport)
+# else
+# define _DLLAPI extern
+# endif
+# if defined(__MINGW32__) || defined(UNDER_CE)
+# define _CALLPROC
+# else
+# define _CALLPROC __stdcall
+# endif
+#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303
+# define _DLLAPI __attribute__((visibility("default")))
+# define _CALLPROC
+#endif /* WIN32 && !CYGWIN */
+
+_DLLAPI void _CALLPROC start_caml_engine() {
char * argv[2];
argv[0] = "--";
argv[1] = NULL;