Handle fastcall declaration differently for some Microsoft compilers
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
/* -----------------------------------------------------------------------
|
/* -----------------------------------------------------------------------
|
||||||
ffi.c - Copyright (c) 1996, 1998, 1999, 2001, 2007, 2008 Red Hat, Inc.
|
ffi.c - Copyright (c) 2017 Anthony Green
|
||||||
|
Copyright (c) 1996, 1998, 1999, 2001, 2007, 2008 Red Hat, Inc.
|
||||||
Copyright (c) 2002 Ranjit Mathew
|
Copyright (c) 2002 Ranjit Mathew
|
||||||
Copyright (c) 2002 Bo Thorsen
|
Copyright (c) 2002 Bo Thorsen
|
||||||
Copyright (c) 2002 Roger Sayle
|
Copyright (c) 2002 Roger Sayle
|
||||||
@@ -234,11 +235,17 @@ static const struct abi_params abi_params[FFI_LAST_ABI] = {
|
|||||||
[FFI_MS_CDECL] = { 1, R_ECX, 0 }
|
[FFI_MS_CDECL] = { 1, R_ECX, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
extern void ffi_call_i386(struct call_frame *, char *)
|
#ifdef HAVE_FASTCALL
|
||||||
#if HAVE_FASTCALL
|
#ifdef _MSC_VER
|
||||||
__declspec(fastcall)
|
#define FFI_DECLARE_FASTCALL __fastcall
|
||||||
|
#else
|
||||||
|
#define FFI_DECLARE_FASTCALL __declspec(fastcall)
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define FFI_DECLARE_FASTCALL
|
||||||
#endif
|
#endif
|
||||||
FFI_HIDDEN;
|
|
||||||
|
extern void FFI_DECLARE_FASTCALL ffi_call_i386(struct call_frame *, char *) FFI_HIDDEN;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
|
ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
|
||||||
@@ -395,10 +402,7 @@ struct closure_frame
|
|||||||
void *user_data; /* 36 */
|
void *user_data; /* 36 */
|
||||||
};
|
};
|
||||||
|
|
||||||
int FFI_HIDDEN
|
int FFI_HIDDEN FFI_DECLARE_FASTCALL
|
||||||
#if HAVE_FASTCALL
|
|
||||||
__declspec(fastcall)
|
|
||||||
#endif
|
|
||||||
ffi_closure_inner (struct closure_frame *frame, char *stack)
|
ffi_closure_inner (struct closure_frame *frame, char *stack)
|
||||||
{
|
{
|
||||||
ffi_cif *cif = frame->cif;
|
ffi_cif *cif = frame->cif;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/* -----------------------------------------------------------------------
|
/* -----------------------------------------------------------------------
|
||||||
sysv.S - Copyright (c) 2013 The Written Word, Inc.
|
sysv.S - Copyright (c) 2017 Anthony Green
|
||||||
- Copyright (c) 1996,1998,2001-2003,2005,2008,2010 Red Hat, Inc.
|
- Copyright (c) 2013 The Written Word, Inc.
|
||||||
|
- Copyright (c) 1996,1998,2001-2003,2005,2008,2010 Red Hat, Inc.
|
||||||
|
|
||||||
X86 Foreign Function Interface
|
X86 Foreign Function Interface
|
||||||
|
|
||||||
@@ -26,6 +27,7 @@
|
|||||||
----------------------------------------------------------------------- */
|
----------------------------------------------------------------------- */
|
||||||
|
|
||||||
#ifndef __x86_64__
|
#ifndef __x86_64__
|
||||||
|
#ifndef _MSC_VER
|
||||||
|
|
||||||
#define LIBFFI_ASM
|
#define LIBFFI_ASM
|
||||||
#include <fficonfig.h>
|
#include <fficonfig.h>
|
||||||
@@ -1033,6 +1035,7 @@ L(SFDE9):
|
|||||||
L(EFDE9):
|
L(EFDE9):
|
||||||
#endif /* !FFI_NO_RAW_API */
|
#endif /* !FFI_NO_RAW_API */
|
||||||
|
|
||||||
|
#endif /* ifndef _MSC_VER */
|
||||||
#endif /* ifndef __x86_64__ */
|
#endif /* ifndef __x86_64__ */
|
||||||
|
|
||||||
#if defined __ELF__ && defined __linux__
|
#if defined __ELF__ && defined __linux__
|
||||||
|
|||||||
Reference in New Issue
Block a user