Add support for stdcall, thiscall, and fastcall on non-Windows x86-32
Linux supports the stdcall calling convention, either via functions explicitly declared with the stdcall attribute, or via code compiled with -mrtd which effectively makes stdcall the default. This introduces FFI_STDCALL, FFI_THISCALL, and FFI_FASTCALL on non-Windows x86-32 platforms, as non-default calling conventions.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
PR: none.
|
||||
Originator: <twalljava@dev.java.net> */
|
||||
|
||||
/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
|
||||
/* { dg-do run { target i?86-*-* } } */
|
||||
#include "ffitest.h"
|
||||
|
||||
static void
|
||||
@@ -23,6 +23,9 @@ closure_test_stdcall(ffi_cif* cif __UNUSED__, void* resp, void** args,
|
||||
|
||||
}
|
||||
|
||||
#ifndef _MSC_VER
|
||||
#define __stdcall __attribute__((stdcall))
|
||||
#endif
|
||||
typedef int (__stdcall *closure_test_type0)(int, int, int, int);
|
||||
|
||||
int main (void)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
PR: none.
|
||||
Originator: <ktietz@redhat.com> */
|
||||
|
||||
/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
|
||||
/* { dg-do run { target i?86-*-* } } */
|
||||
#include "ffitest.h"
|
||||
|
||||
static void
|
||||
@@ -23,6 +23,9 @@ closure_test_thiscall(ffi_cif* cif __UNUSED__, void* resp, void** args,
|
||||
|
||||
}
|
||||
|
||||
#ifndef _MSC_VER
|
||||
#define __thiscall __attribute__((thiscall))
|
||||
#endif
|
||||
typedef int (__thiscall *closure_test_type0)(int, int, int, int);
|
||||
|
||||
int main (void)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
PR: none.
|
||||
Originator: From the original ffitest.c */
|
||||
|
||||
/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
|
||||
/* { dg-do run { target i?86-*-* } } */
|
||||
|
||||
#include "ffitest.h"
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
PR: none.
|
||||
Originator: From the original ffitest.c */
|
||||
|
||||
/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
|
||||
/* { dg-do run { target i?86-*-* } } */
|
||||
|
||||
#include "ffitest.h"
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
PR: none.
|
||||
Originator: From the original ffitest.c */
|
||||
|
||||
/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
|
||||
/* { dg-do run { target i?86-*-* } } */
|
||||
|
||||
#include "ffitest.h"
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
PR: none.
|
||||
Originator: From the original ffitest.c */
|
||||
|
||||
/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
|
||||
/* { dg-do run { target i?86-*-* } } */
|
||||
|
||||
#include "ffitest.h"
|
||||
#include <float.h>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
PR: none.
|
||||
Originator: From the original ffitest.c */
|
||||
|
||||
/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
|
||||
/* { dg-do run { target i?86-*-* } } */
|
||||
|
||||
#include "ffitest.h"
|
||||
#include <float.h>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
PR: none.
|
||||
Originator: From the original ffitest.c */
|
||||
|
||||
/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
|
||||
/* { dg-do run { target i?86-*-* } } */
|
||||
|
||||
#include "ffitest.h"
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
PR: none.
|
||||
Originator: From the original ffitest.c */
|
||||
|
||||
/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
|
||||
/* { dg-do run { target i?86-*-* } } */
|
||||
|
||||
#include "ffitest.h"
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
PR: none.
|
||||
Originator: From the original ffitest.c */
|
||||
|
||||
/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
|
||||
/* { dg-do run { target i?86-*-* } } */
|
||||
#include "ffitest.h"
|
||||
|
||||
typedef struct
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
PR: none.
|
||||
Originator: From the original ffitest.c */
|
||||
|
||||
/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
|
||||
/* { dg-do run { target i?86-*-* } } */
|
||||
#include "ffitest.h"
|
||||
|
||||
typedef struct
|
||||
|
||||
Reference in New Issue
Block a user