summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2014-03-16 15:16:18 -0700
committerJosh Triplett <josh@joshtriplett.org>2014-03-16 15:27:07 -0700
commitbad8948346e9b8813023a0cc78a3b6eb8d9c14c6 (patch)
treed462e3fbbcce2038958292b6298adbc568fae5de /testsuite
parent98a793fa36a4ab3ba24d059cb80a2891cdb940e1 (diff)
downloadlibffi-bad8948346e9b8813023a0cc78a3b6eb8d9c14c6.tar.gz
testsuite: Introduce a __STDCALL__ compiler-specific macro
Several tests want to use stdcall, which differs in syntax by compiler, so introduce a macro for it in ffitest.h.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/libffi.call/closure_stdcall.c5
-rw-r--r--testsuite/libffi.call/ffitest.h2
2 files changed, 3 insertions, 4 deletions
diff --git a/testsuite/libffi.call/closure_stdcall.c b/testsuite/libffi.call/closure_stdcall.c
index 871d576..fd1e4b0 100644
--- a/testsuite/libffi.call/closure_stdcall.c
+++ b/testsuite/libffi.call/closure_stdcall.c
@@ -23,10 +23,7 @@ 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);
+typedef int (__STDCALL__ *closure_test_type0)(int, int, int, int);
int main (void)
{
diff --git a/testsuite/libffi.call/ffitest.h b/testsuite/libffi.call/ffitest.h
index 7c0f8e4..2fc2535 100644
--- a/testsuite/libffi.call/ffitest.h
+++ b/testsuite/libffi.call/ffitest.h
@@ -21,9 +21,11 @@
#undef __UNUSED__
#if defined(__GNUC__)
#define __UNUSED__ __attribute__((__unused__))
+#define __STDCALL__ __attribute__((stdcall))
#define __FASTCALL__ __attribute__((fastcall))
#else
#define __UNUSED__
+#define __STDCALL__ __stdcall
#define __FASTCALL__ __fastcall
#endif