You may specify a non-standard calling convention in place of `extern`, where `default` and `cdecl` have the same meaning as `extern`.
-Additionally recognized calling conventions include: `mscdecl`, `stdcall` and `fastcall`.
+Additionally recognized calling conventions include: `stdcall` and `fastcall`.
### Constants
AC_MSG_WARN([Could not find libffi, please provide the base install path])
fi
fi
+
+ save_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS $INCLUDES"
+ AC_CHECK_DECL(FFI_STDCALL,[AC_DEFINE([HAVE_FFI_STDCALL],[1],[ ])],,[#include "ffi.h"])
+ AC_CHECK_DECL(FFI_FASTCALL,[AC_DEFINE([HAVE_FFI_FASTCALL],[1],[ ])],,[#include "ffi.h"])
+ CFLAGS=$save_CFLAGS
+
PHP_CHECK_LIBRARY(ffi, ffi_closure_alloc, [
PHP_CHECK_LIBRARY(ffi, ffi_prep_closure_loc, [
AC_DEFINE(PSI_HAVE_FFI_PREP_CLOSURE_LOC, 1, [ ])
}
static inline ffi_abi psi_ffi_abi(const char *convention) {
+ if (FFI_LAST_ABI - 2 != FFI_FIRST_ABI) {
+#ifdef HAVE_FFI_STDCALL
+ if (!strcasecmp(convention, "stdcall")) {
+ return FFI_STDCALL;
+ }
+#endif
+#ifdef HAVE_FFI_FASTCALL
+ if (!strcasecmp(convention, "fastcall")) {
+ return FFI_FASTCALL;
+ }
+#endif
+ }
return FFI_DEFAULT_ABI;
}
static inline jit_abi_t psi_jit_abi(const char *convention)
{
+ if (!strcasecmp(convention, "stdcall")) {
+ return jit_abi_stdcall;
+ }
+ if (!strcasecmp(convention, "fastcall")) {
+ return jit_abi_fastcall;
+ }
return jit_abi_cdecl;
}
static inline jit_type_t psi_jit_token_type(token_t t)
"default", /* \ */
"extern", /* > - all the same */
"cdecl", /* / */
- "mscdecl",
"stdcall",
"fastcall",
};