diff --git a/moo/Makefile.in b/moo/Makefile.in index 818b03e..6abe8c6 100644 --- a/moo/Makefile.in +++ b/moo/Makefile.in @@ -222,6 +222,7 @@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ +DYNCALL_LIBS = @DYNCALL_LIBS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ diff --git a/moo/configure b/moo/configure index a942b3e..4ffc6e1 100755 --- a/moo/configure +++ b/moo/configure @@ -666,6 +666,7 @@ PACKAGE_VERSION_MINOR PACKAGE_VERSION_MAJOR QUADMATH_LIBS UNICOWS_LIBS +DYNCALL_LIBS LIBM WIN32_FALSE WIN32_TRUE @@ -18194,6 +18195,18 @@ fi done +for ac_header in dyncall.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "dyncall.h" "ac_cv_header_dyncall_h" "$ac_includes_default" +if test "x$ac_cv_header_dyncall_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DYNCALL_H 1 +_ACEOF + +fi + +done + for ac_func in gettimeofday settimeofday clock_gettime clock_settime getitimer setitimer @@ -18245,6 +18258,54 @@ fi done +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dcNewCallVM in -ldyncall_s" >&5 +$as_echo_n "checking for dcNewCallVM in -ldyncall_s... " >&6; } +if ${ac_cv_lib_dyncall_s_dcNewCallVM+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldyncall_s $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dcNewCallVM (); +int +main () +{ +return dcNewCallVM (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dyncall_s_dcNewCallVM=yes +else + ac_cv_lib_dyncall_s_dcNewCallVM=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dyncall_s_dcNewCallVM" >&5 +$as_echo "$ac_cv_lib_dyncall_s_dcNewCallVM" >&6; } +if test "x$ac_cv_lib_dyncall_s_dcNewCallVM" = xyes; then : + + DYNCALL_LIBS="-ldyncall_s" + +$as_echo "#define HAVE_DYNCALL_LIB 1" >>confdefs.h + + + +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lunicows" >&5 $as_echo_n "checking for main in -lunicows... " >&6; } if ${ac_cv_lib_unicows_main+:} false; then : diff --git a/moo/configure.ac b/moo/configure.ac index c086fd5..1fa08a3 100644 --- a/moo/configure.ac +++ b/moo/configure.ac @@ -143,6 +143,7 @@ dnl check header files. AC_HEADER_STDC AC_CHECK_HEADERS([stddef.h wchar.h wctype.h errno.h signal.h fcntl.h dirent.h]) AC_CHECK_HEADERS([time.h sys/time.h utime.h spawn.h execinfo.h ucontext.h]) +AC_CHECK_HEADERS([dyncall.h]) dnl check data types dnl AC_CHECK_TYPE([wchar_t], @@ -157,6 +158,14 @@ AC_CHECK_FUNCS([backtrace backtrace_symbols]) AC_CHECK_FUNCS([makecontext swapcontext getcontext setcontext]) AC_CHECK_FUNCS([snprintf _vsnprintf _vsnwprintf]) +AC_CHECK_LIB([dyncall_s], [dcNewCallVM], + [ + DYNCALL_LIBS="-ldyncall_s" + AC_DEFINE([HAVE_DYNCALL_LIB], [1], [dyncall library is available]) + ] +) +AC_SUBST(DYNCALL_LIBS) + dnl check is the import library for unicows.dll exists dnl this check doesn't look for a particular symbol dnl but for the symbol 'main' since i want to check diff --git a/moo/lib/Makefile.in b/moo/lib/Makefile.in index d092b01..0cf1c56 100644 --- a/moo/lib/Makefile.in +++ b/moo/lib/Makefile.in @@ -247,6 +247,7 @@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ +DYNCALL_LIBS = @DYNCALL_LIBS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ diff --git a/moo/lib/bigint.c b/moo/lib/bigint.c index 44b5bfc..b9f6495 100644 --- a/moo/lib/bigint.c +++ b/moo/lib/bigint.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/comp.c b/moo/lib/comp.c index 15823c0..2569b3e 100644 --- a/moo/lib/comp.c +++ b/moo/lib/comp.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/debug.c b/moo/lib/debug.c index 2d3399b..866327f 100644 --- a/moo/lib/debug.c +++ b/moo/lib/debug.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/decode.c b/moo/lib/decode.c index c8e4722..4404437 100644 --- a/moo/lib/decode.c +++ b/moo/lib/decode.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/dic.c b/moo/lib/dic.c index 4caa3be..94791a3 100644 --- a/moo/lib/dic.c +++ b/moo/lib/dic.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/err.c b/moo/lib/err.c index 0356437..51cda7c 100644 --- a/moo/lib/err.c +++ b/moo/lib/err.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/exec.c b/moo/lib/exec.c index afdb657..6945b53 100644 --- a/moo/lib/exec.c +++ b/moo/lib/exec.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/gc.c b/moo/lib/gc.c index 1f966e1..1c3db0e 100644 --- a/moo/lib/gc.c +++ b/moo/lib/gc.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/heap.c b/moo/lib/heap.c index e851fe0..94546c7 100644 --- a/moo/lib/heap.c +++ b/moo/lib/heap.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/logfmt.c b/moo/lib/logfmt.c index d9f49d1..e2b3653 100644 --- a/moo/lib/logfmt.c +++ b/moo/lib/logfmt.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/logfmtv.h b/moo/lib/logfmtv.h index 27c5c58..07df1e3 100644 --- a/moo/lib/logfmtv.h +++ b/moo/lib/logfmtv.h @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/main.c b/moo/lib/main.c index c9511ca..2634678 100644 --- a/moo/lib/main.c +++ b/moo/lib/main.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/moo-cfg.h.in b/moo/lib/moo-cfg.h.in index bc55f03..48029ce 100644 --- a/moo/lib/moo-cfg.h.in +++ b/moo/lib/moo-cfg.h.in @@ -91,6 +91,12 @@ /* Define if you have the _dyld_func_lookup function. */ #undef HAVE_DYLD +/* Define to 1 if you have the header file. */ +#undef HAVE_DYNCALL_H + +/* dyncall library is available */ +#undef HAVE_DYNCALL_LIB + /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H diff --git a/moo/lib/moo-cmn.h b/moo/lib/moo-cmn.h index b4ae7ad..0907f55 100644 --- a/moo/lib/moo-cmn.h +++ b/moo/lib/moo-cmn.h @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/moo-dos.h b/moo/lib/moo-dos.h index 8262239..6bd8f1f 100644 --- a/moo/lib/moo-dos.h +++ b/moo/lib/moo-dos.h @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/moo-mac.h b/moo/lib/moo-mac.h index 734a441..03e312f 100644 --- a/moo/lib/moo-mac.h +++ b/moo/lib/moo-mac.h @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/moo-msw.h b/moo/lib/moo-msw.h index fdbf041..f3a322e 100644 --- a/moo/lib/moo-msw.h +++ b/moo/lib/moo-msw.h @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/moo-os2.h b/moo/lib/moo-os2.h index ffc3476..e9effad 100644 --- a/moo/lib/moo-os2.h +++ b/moo/lib/moo-os2.h @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/moo-prv.h b/moo/lib/moo-prv.h index 1a36aec..9af40cb 100644 --- a/moo/lib/moo-prv.h +++ b/moo/lib/moo-prv.h @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/moo-rbt.h b/moo/lib/moo-rbt.h index 0956876..1ebe75e 100644 --- a/moo/lib/moo-rbt.h +++ b/moo/lib/moo-rbt.h @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/moo-utl.h b/moo/lib/moo-utl.h index a0169bb..357e895 100644 --- a/moo/lib/moo-utl.h +++ b/moo/lib/moo-utl.h @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/moo.c b/moo/lib/moo.c index 1669ac2..752e8a5 100644 --- a/moo/lib/moo.c +++ b/moo/lib/moo.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/moo.h b/moo/lib/moo.h index 9ed0225..637d742 100644 --- a/moo/lib/moo.h +++ b/moo/lib/moo.h @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/obj.c b/moo/lib/obj.c index 8162fda..d906163 100644 --- a/moo/lib/obj.c +++ b/moo/lib/obj.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/proc.c b/moo/lib/proc.c index a56d0af..3ecf1ea 100644 --- a/moo/lib/proc.c +++ b/moo/lib/proc.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/rbt.c b/moo/lib/rbt.c index df00410..49dee50 100644 --- a/moo/lib/rbt.c +++ b/moo/lib/rbt.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/sym.c b/moo/lib/sym.c index 8a49371..c680281 100644 --- a/moo/lib/sym.c +++ b/moo/lib/sym.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/utf8.c b/moo/lib/utf8.c index fad7ab1..f717acc 100644 --- a/moo/lib/utf8.c +++ b/moo/lib/utf8.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/lib/utl.c b/moo/lib/utl.c index 27d3e8f..e52f928 100644 --- a/moo/lib/utl.c +++ b/moo/lib/utl.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/mod/Makefile.am b/moo/mod/Makefile.am index 7ec0c5b..b47796c 100644 --- a/moo/mod/Makefile.am +++ b/moo/mod/Makefile.am @@ -46,7 +46,7 @@ libmoo_console_la_LIBADD = $(LIBADD_COMMON) -ltermcap libmoo_ffi_la_SOURCES = ffi.c _ffi.h libmoo_ffi_la_CPPFLAGS = $(CPPFLAGS_COMMON) libmoo_ffi_la_LDFLAGS = $(LDFLAGS_COMMON) -libmoo_ffi_la_LIBADD = $(LIBADD_COMMON) -ldyncall_s +libmoo_ffi_la_LIBADD = $(LIBADD_COMMON) $(DYNCALL_LIBS) libmoo_stdio_la_SOURCES = stdio.c _stdio.h libmoo_stdio_la_CPPFLAGS = $(CPPFLAGS_COMMON) diff --git a/moo/mod/Makefile.in b/moo/mod/Makefile.in index 06a1ead..e08c322 100644 --- a/moo/mod/Makefile.in +++ b/moo/mod/Makefile.in @@ -143,7 +143,8 @@ libmoo_console_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ @ENABLE_STATIC_MODULE_FALSE@am_libmoo_console_la_rpath = -rpath \ @ENABLE_STATIC_MODULE_FALSE@ $(pkgmodexecdir) @ENABLE_STATIC_MODULE_TRUE@am_libmoo_console_la_rpath = -libmoo_ffi_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +libmoo_ffi_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) am_libmoo_ffi_la_OBJECTS = libmoo_ffi_la-ffi.lo libmoo_ffi_la_OBJECTS = $(am_libmoo_ffi_la_OBJECTS) libmoo_ffi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -250,6 +251,7 @@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ +DYNCALL_LIBS = @DYNCALL_LIBS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ @@ -410,7 +412,7 @@ libmoo_console_la_LIBADD = $(LIBADD_COMMON) -ltermcap libmoo_ffi_la_SOURCES = ffi.c _ffi.h libmoo_ffi_la_CPPFLAGS = $(CPPFLAGS_COMMON) libmoo_ffi_la_LDFLAGS = $(LDFLAGS_COMMON) -libmoo_ffi_la_LIBADD = $(LIBADD_COMMON) -ldyncall_s +libmoo_ffi_la_LIBADD = $(LIBADD_COMMON) $(DYNCALL_LIBS) libmoo_stdio_la_SOURCES = stdio.c _stdio.h libmoo_stdio_la_CPPFLAGS = $(CPPFLAGS_COMMON) libmoo_stdio_la_LDFLAGS = $(LDFLAGS_COMMON) diff --git a/moo/mod/_ffi.h b/moo/mod/_ffi.h index edee49b..5a8964f 100644 --- a/moo/mod/_ffi.h +++ b/moo/mod/_ffi.h @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2006-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/mod/_stdio.h b/moo/mod/_stdio.h index 8de5e82..a11b871 100644 --- a/moo/mod/_stdio.h +++ b/moo/mod/_stdio.h @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2006-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/mod/console.c b/moo/mod/console.c index ac29095..bc8bf3c 100644 --- a/moo/mod/console.c +++ b/moo/mod/console.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/mod/console.h b/moo/mod/console.h index 430f811..d735a9e 100644 --- a/moo/mod/console.h +++ b/moo/mod/console.h @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2006-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/moo/mod/ffi.c b/moo/mod/ffi.c index fa46ee1..ca1cdaa 100644 --- a/moo/mod/ffi.c +++ b/moo/mod/ffi.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -30,9 +30,11 @@ #include #include -#define HAVE_DYNCALL +#if defined(HAVE_DYNCALL_LIB) && defined(HAVE_DYNCALL_H) +# define USE_DYNCALL +#endif -#if defined(HAVE_DYNCALL) +#if defined(USE_DYNCALL) # include #endif @@ -54,7 +56,7 @@ static moo_pfrc_t pf_newinstsize (moo_t* moo, moo_ooi_t nargs) static moo_pfrc_t pf_open (moo_t* moo, moo_ooi_t nargs) { -#if defined(HAVE_DYNCALL) +#if defined(USE_DYNCALL) ffi_t* rcv; moo_oop_t name; @@ -91,13 +93,14 @@ reterr: return MOO_PF_SUCCESS; #else moo_seterrnum (moo, MOO_ENOIMPL); - return MOO_PF_FAILURE; + MOO_STACK_SETRETTOERROR (moo, nargs); + return MOO_PF_SUCCESS; #endif } static moo_pfrc_t pf_close (moo_t* moo, moo_ooi_t nargs) { -#if defined(HAVE_DYNCALL) +#if defined(USE_DYNCALL) ffi_t* rcv; if (nargs != 0) @@ -128,13 +131,14 @@ reterr: #else moo_seterrnum (moo, MOO_ENOIMPL); - return MOO_PF_FAILURE; + MOO_STACK_SETRETTOERROR (moo, nargs); + return MOO_PF_SUCCESS; #endif } static moo_pfrc_t pf_call (moo_t* moo, moo_ooi_t nargs) { -#if defined(HAVE_DYNCALL) +#if defined(USE_DYNCALL) ffi_t* rcv; moo_oop_t fun, sig, args; @@ -343,13 +347,14 @@ reterr: #else moo_seterrnum (moo, MOO_ENOIMPL); - return MOO_PF_FAILURE; + MOO_STACK_SETRETTOERROR (moo, nargs); + return MOO_PF_SUCCESS; #endif } static moo_pfrc_t pf_getsym (moo_t* moo, moo_ooi_t nargs) { -#if defined(HAVE_DYNCALL) +#if defined(USE_DYNCALL) ffi_t* rcv; moo_oop_t name; void* sym; @@ -390,7 +395,8 @@ reterr: #else moo_seterrnum (moo, MOO_ENOIMPL); - return MOO_PF_FAILURE; + MOO_STACK_SETRETTOERROR (moo, nargs); + return MOO_PF_SUCCESS; #endif } diff --git a/moo/mod/icc.mak b/moo/mod/icc.mak index cad3756..5b8410d 100644 --- a/moo/mod/icc.mak +++ b/moo/mod/icc.mak @@ -4,10 +4,9 @@ CFLAGS := /D__DOS__ /DMOO_ENABLE_STATIC_MODULE /DNDEBUG /I..\lib -# ffi.c \ - SRCS := \ console.c \ + ffi.c \ stdio.c OBJS := $(SRCS:.c=.obj) diff --git a/moo/mod/stdio.c b/moo/mod/stdio.c index ce71c4b..4991b11 100644 --- a/moo/mod/stdio.c +++ b/moo/mod/stdio.c @@ -1,7 +1,7 @@ /* * $Id$ * - Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions