summaryrefslogtreecommitdiff
path: root/ext/ffi_c/libffi/include/ffi_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/ffi_c/libffi/include/ffi_common.h')
-rw-r--r--ext/ffi_c/libffi/include/ffi_common.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/ext/ffi_c/libffi/include/ffi_common.h b/ext/ffi_c/libffi/include/ffi_common.h
index d953762..37f5a9e 100644
--- a/ext/ffi_c/libffi/include/ffi_common.h
+++ b/ext/ffi_c/libffi/include/ffi_common.h
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------
- ffi_common.h - Copyright (C) 2011 Anthony Green
+ ffi_common.h - Copyright (C) 2011, 2012, 2013 Anthony Green
Copyright (C) 2007 Free Software Foundation, Inc
Copyright (c) 1996 Red Hat, Inc.
@@ -19,10 +19,14 @@ extern "C" {
/* Do not move this. Some versions of AIX are very picky about where
this is positioned. */
#ifdef __GNUC__
-/* mingw64 defines this already in malloc.h. */
-#ifndef alloca
-# define alloca __builtin_alloca
-#endif
+# if HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+ /* mingw64 defines this already in malloc.h. */
+# ifndef alloca
+# define alloca __builtin_alloca
+# endif
+# endif
# define MAYBE_UNUSED __attribute__((__unused__))
#else
# define MAYBE_UNUSED
@@ -30,17 +34,17 @@ extern "C" {
# include <alloca.h>
# else
# ifdef _AIX
- #pragma alloca
+# pragma alloca
# else
# ifndef alloca /* predefined by HP cc +Olibcalls */
# ifdef _MSC_VER
# define alloca _alloca
# else
char *alloca ();
-# endif
# endif
# endif
# endif
+# endif
#endif
/* Check for the existence of memcpy. */
@@ -75,6 +79,8 @@ void ffi_type_test(ffi_type *a, char *file, int line);
/* Perform machine dependent cif processing */
ffi_status ffi_prep_cif_machdep(ffi_cif *cif);
+ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif,
+ unsigned int nfixedargs, unsigned int ntotalargs);
/* Extended cif, used in callback from assembly routine */
typedef struct
@@ -85,7 +91,7 @@ typedef struct
} extended_cif;
/* Terse sized type definitions. */
-#if defined(_MSC_VER) || defined(__sgi)
+#if defined(_MSC_VER) || defined(__sgi) || defined(__SUNPRO_C)
typedef unsigned char UINT8;
typedef signed char SINT8;
typedef unsigned short UINT16;
@@ -116,8 +122,8 @@ typedef float FLOAT32;
#ifndef __GNUC__
#define __builtin_expect(x, expected_value) (x)
#endif
-#define LIKELY(x) __builtin_expect((x),1)
-#define UNLIKELY(x) __builtin_expect((x),1)
+#define LIKELY(x) __builtin_expect(!!(x),1)
+#define UNLIKELY(x) __builtin_expect((x)!=0,0)
#ifdef __cplusplus
}