]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libffi/testsuite/libffi.call/ffitest.h
libffi: Sync with libffi 3.4.2
[thirdparty/gcc.git] / libffi / testsuite / libffi.call / ffitest.h
index 15d5e44123481942d4dbd59960620f7f9d243c55..95d96a83f18c7dfa3cb6beea988e71e7f90b1514 100644 (file)
 
 #define MAX_ARGS 256
 
-#define CHECK(x) (void)(!(x) ? (abort(), 1) : 0)
+#define CHECK(x) \
+   do { \
+      if(!(x)){ \
+         printf("Check failed:\n%s\n", #x); \
+         abort(); \
+      } \
+   } while(0)
 
 /* Define macros so that compilers other than gcc can run the tests.  */
 #undef __UNUSED__
@@ -24,6 +30,7 @@
 #define __STDCALL__ __attribute__((stdcall))
 #define __THISCALL__ __attribute__((thiscall))
 #define __FASTCALL__ __attribute__((fastcall))
+#define __MSABI__ __attribute__((ms_abi))
 #else
 #define __UNUSED__
 #define __STDCALL__ __stdcall
@@ -63,7 +70,7 @@
 #endif
 
 /* MinGW kludge.  */
-#ifdef _WIN64
+#if defined(_WIN64) | defined(_WIN32)
 #define PRIdLL "I64d"
 #define PRIuLL "I64u"
 #else
 
 /* MSVC kludge.  */
 #if defined _MSC_VER
+#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
 #define PRIuPTR "lu"
 #define PRIu8 "u"
 #define PRId8 "d"
 #define PRIu64 "I64u"
 #define PRId64 "I64d"
 #endif
+#endif
 
 #ifndef PRIuPTR
 #define PRIuPTR "u"