summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnthony Green <green@moxielogic.com>2010-07-23 09:14:00 -0400
committerAnthony Green <green@moxielogic.com>2010-07-23 09:14:00 -0400
commitd14178be4c49c3ada44a9fe9efe11d444372ddab (patch)
treead3ccae8704bff17f7b4b43b5cc4ff4af67c366a /src
parent3f5b1375ab1e2b8e3d593e21b27097a4a50f9b83 (diff)
downloadlibffi-d14178be4c49c3ada44a9fe9efe11d444372ddab.tar.gz
FFI_LAST_ABI fix
Diffstat (limited to 'src')
-rw-r--r--src/arm/ffitarget.h4
-rw-r--r--src/avr32/ffitarget.h4
-rw-r--r--src/cris/ffi.c2
-rw-r--r--src/cris/ffitarget.h4
-rw-r--r--src/frv/ffitarget.h8
-rw-r--r--src/ia64/ffitarget.h4
-rw-r--r--src/m32r/ffitarget.h4
-rw-r--r--src/m68k/ffitarget.h4
-rw-r--r--src/mips/ffitarget.h15
-rw-r--r--src/moxie/ffitarget.h8
-rw-r--r--src/pa/ffitarget.h11
-rw-r--r--src/prep_cif.c2
-rw-r--r--src/s390/ffitarget.h4
-rw-r--r--src/sh/ffitarget.h4
-rw-r--r--src/sh64/ffitarget.h4
-rw-r--r--src/sparc/ffitarget.h6
-rw-r--r--src/x86/ffitarget.h13
17 files changed, 47 insertions, 54 deletions
diff --git a/src/arm/ffitarget.h b/src/arm/ffitarget.h
index a957426..eede79f 100644
--- a/src/arm/ffitarget.h
+++ b/src/arm/ffitarget.h
@@ -34,8 +34,8 @@ typedef signed long ffi_sarg;
typedef enum ffi_abi {
FFI_FIRST_ABI = 0,
FFI_SYSV,
- FFI_DEFAULT_ABI = FFI_SYSV,
- FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
+ FFI_LAST_ABI,
+ FFI_DEFAULT_ABI = FFI_SYSV
} ffi_abi;
#endif
diff --git a/src/avr32/ffitarget.h b/src/avr32/ffitarget.h
index 1c799b1..b85d062 100644
--- a/src/avr32/ffitarget.h
+++ b/src/avr32/ffitarget.h
@@ -34,8 +34,8 @@ typedef signed long ffi_sarg;
typedef enum ffi_abi {
FFI_FIRST_ABI = 0,
FFI_SYSV,
- FFI_DEFAULT_ABI = FFI_SYSV,
- FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
+ FFI_LAST_ABI,
+ FFI_DEFAULT_ABI = FFI_SYSV
} ffi_abi;
#endif
diff --git a/src/cris/ffi.c b/src/cris/ffi.c
index e9c3953..f25d7b4 100644
--- a/src/cris/ffi.c
+++ b/src/cris/ffi.c
@@ -163,7 +163,7 @@ ffi_prep_cif (ffi_cif * cif,
ffi_type **ptr;
FFI_ASSERT (cif != NULL);
- FFI_ASSERT ((abi > FFI_FIRST_ABI) && (abi <= FFI_DEFAULT_ABI));
+ FFI_ASSERT (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI);
cif->abi = abi;
cif->arg_types = atypes;
diff --git a/src/cris/ffitarget.h b/src/cris/ffitarget.h
index 4257f10..0e3705d 100644
--- a/src/cris/ffitarget.h
+++ b/src/cris/ffitarget.h
@@ -34,8 +34,8 @@ typedef signed long ffi_sarg;
typedef enum ffi_abi {
FFI_FIRST_ABI = 0,
FFI_SYSV,
- FFI_DEFAULT_ABI = FFI_SYSV,
- FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
+ FFI_LAST_ABI,
+ FFI_DEFAULT_ABI = FFI_SYSV
} ffi_abi;
#endif
diff --git a/src/frv/ffitarget.h b/src/frv/ffitarget.h
index 1c319ea..4839069 100644
--- a/src/frv/ffitarget.h
+++ b/src/frv/ffitarget.h
@@ -35,13 +35,9 @@ typedef signed long ffi_sarg;
typedef enum ffi_abi {
FFI_FIRST_ABI = 0,
-
-#ifdef FRV
FFI_EABI,
- FFI_DEFAULT_ABI = FFI_EABI,
-#endif
-
- FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
+ FFI_LAST_ABI,
+ FFI_DEFAULT_ABI = FFI_EABI
} ffi_abi;
#endif
diff --git a/src/ia64/ffitarget.h b/src/ia64/ffitarget.h
index d85c049..0d2001d 100644
--- a/src/ia64/ffitarget.h
+++ b/src/ia64/ffitarget.h
@@ -34,8 +34,8 @@ typedef signed long long ffi_sarg;
typedef enum ffi_abi {
FFI_FIRST_ABI = 0,
FFI_UNIX, /* Linux and all Unix variants use the same conventions */
- FFI_DEFAULT_ABI = FFI_UNIX,
- FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
+ FFI_LAST_ABI,
+ FFI_DEFAULT_ABI = FFI_UNIX
} ffi_abi;
#endif
diff --git a/src/m32r/ffitarget.h b/src/m32r/ffitarget.h
index 6a761f6..2e2ea48 100644
--- a/src/m32r/ffitarget.h
+++ b/src/m32r/ffitarget.h
@@ -36,8 +36,8 @@ typedef enum ffi_abi
{
FFI_FIRST_ABI = 0,
FFI_SYSV,
- FFI_DEFAULT_ABI = FFI_SYSV,
- FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
+ FFI_LAST_ABI,
+ FFI_DEFAULT_ABI = FFI_SYSV
} ffi_abi;
#endif
diff --git a/src/m68k/ffitarget.h b/src/m68k/ffitarget.h
index 633717b..3b777ed 100644
--- a/src/m68k/ffitarget.h
+++ b/src/m68k/ffitarget.h
@@ -34,8 +34,8 @@ typedef signed long ffi_sarg;
typedef enum ffi_abi {
FFI_FIRST_ABI = 0,
FFI_SYSV,
- FFI_DEFAULT_ABI = FFI_SYSV,
- FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
+ FFI_LAST_ABI,
+ FFI_DEFAULT_ABI = FFI_SYSV
} ffi_abi;
#endif
diff --git a/src/mips/ffitarget.h b/src/mips/ffitarget.h
index c5f4e05..d70197c 100644
--- a/src/mips/ffitarget.h
+++ b/src/mips/ffitarget.h
@@ -186,30 +186,29 @@ typedef enum ffi_abi {
FFI_O32_SOFT_FLOAT,
FFI_N32_SOFT_FLOAT,
FFI_N64_SOFT_FLOAT,
+ FFI_LAST_ABI,
#ifdef FFI_MIPS_O32
#ifdef __mips_soft_float
- FFI_DEFAULT_ABI = FFI_O32_SOFT_FLOAT,
+ FFI_DEFAULT_ABI = FFI_O32_SOFT_FLOAT
#else
- FFI_DEFAULT_ABI = FFI_O32,
+ FFI_DEFAULT_ABI = FFI_O32
#endif
#else
# if _MIPS_SIM==_ABI64
# ifdef __mips_soft_float
- FFI_DEFAULT_ABI = FFI_N64_SOFT_FLOAT,
+ FFI_DEFAULT_ABI = FFI_N64_SOFT_FLOAT
# else
- FFI_DEFAULT_ABI = FFI_N64,
+ FFI_DEFAULT_ABI = FFI_N64
# endif
# else
# ifdef __mips_soft_float
- FFI_DEFAULT_ABI = FFI_N32_SOFT_FLOAT,
+ FFI_DEFAULT_ABI = FFI_N32_SOFT_FLOAT
# else
- FFI_DEFAULT_ABI = FFI_N32,
+ FFI_DEFAULT_ABI = FFI_N32
# endif
# endif
#endif
-
- FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
} ffi_abi;
#define FFI_EXTRA_CIF_FIELDS unsigned rstruct_flag
diff --git a/src/moxie/ffitarget.h b/src/moxie/ffitarget.h
index f5305d1..2a9d954 100644
--- a/src/moxie/ffitarget.h
+++ b/src/moxie/ffitarget.h
@@ -35,13 +35,9 @@ typedef signed long ffi_sarg;
typedef enum ffi_abi {
FFI_FIRST_ABI = 0,
-
-#ifdef MOXIE
FFI_EABI,
- FFI_DEFAULT_ABI = FFI_EABI,
-#endif
-
- FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
+ FFI_LAST_ABI,
+ FFI_DEFAULT_ABI = FFI_EABI
} ffi_abi;
#endif
diff --git a/src/pa/ffitarget.h b/src/pa/ffitarget.h
index 001f891..efa2f4e 100644
--- a/src/pa/ffitarget.h
+++ b/src/pa/ffitarget.h
@@ -38,21 +38,22 @@ typedef enum ffi_abi {
#ifdef PA_LINUX
FFI_PA32,
- FFI_DEFAULT_ABI = FFI_PA32,
+ FFI_LAST_ABI,
+ FFI_DEFAULT_ABI = FFI_PA32
#endif
#ifdef PA_HPUX
FFI_PA32,
- FFI_DEFAULT_ABI = FFI_PA32,
+ FFI_LAST_ABI,
+ FFI_DEFAULT_ABI = FFI_PA32
#endif
#ifdef PA64_HPUX
#error "PA64_HPUX FFI is not yet implemented"
FFI_PA64,
- FFI_DEFAULT_ABI = FFI_PA64,
+ FFI_LAST_ABI,
+ FFI_DEFAULT_ABI = FFI_PA64
#endif
-
- FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
} ffi_abi;
#endif
diff --git a/src/prep_cif.c b/src/prep_cif.c
index c1c3b9a..5d749ef 100644
--- a/src/prep_cif.c
+++ b/src/prep_cif.c
@@ -93,7 +93,7 @@ ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs,
ffi_type **ptr;
FFI_ASSERT(cif != NULL);
- FFI_ASSERT((abi > FFI_FIRST_ABI) && (abi <= FFI_DEFAULT_ABI));
+ FFI_ASSERT(abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI);
cif->abi = abi;
cif->arg_types = atypes;
diff --git a/src/s390/ffitarget.h b/src/s390/ffitarget.h
index 78f3c65..41d7a7d 100644
--- a/src/s390/ffitarget.h
+++ b/src/s390/ffitarget.h
@@ -40,8 +40,8 @@ typedef signed long ffi_sarg;
typedef enum ffi_abi {
FFI_FIRST_ABI = 0,
FFI_SYSV,
- FFI_DEFAULT_ABI = FFI_SYSV,
- FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
+ FFI_LAST_ABI,
+ FFI_DEFAULT_ABI = FFI_SYSV
} ffi_abi;
#endif
diff --git a/src/sh/ffitarget.h b/src/sh/ffitarget.h
index 218ae3d..4f1f639 100644
--- a/src/sh/ffitarget.h
+++ b/src/sh/ffitarget.h
@@ -36,8 +36,8 @@ typedef signed long ffi_sarg;
typedef enum ffi_abi {
FFI_FIRST_ABI = 0,
FFI_SYSV,
- FFI_DEFAULT_ABI = FFI_SYSV,
- FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
+ FFI_LAST_ABI,
+ FFI_DEFAULT_ABI = FFI_SYSV
} ffi_abi;
#endif
diff --git a/src/sh64/ffitarget.h b/src/sh64/ffitarget.h
index 4e922fc..d935b89 100644
--- a/src/sh64/ffitarget.h
+++ b/src/sh64/ffitarget.h
@@ -36,8 +36,8 @@ typedef signed long ffi_sarg;
typedef enum ffi_abi {
FFI_FIRST_ABI = 0,
FFI_SYSV,
- FFI_DEFAULT_ABI = FFI_SYSV,
- FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
+ FFI_LAST_ABI,
+ FFI_DEFAULT_ABI = FFI_SYSV
} ffi_abi;
#define FFI_EXTRA_CIF_FIELDS long long flags2
diff --git a/src/sparc/ffitarget.h b/src/sparc/ffitarget.h
index 1a1a1ac..f3ad606 100644
--- a/src/sparc/ffitarget.h
+++ b/src/sparc/ffitarget.h
@@ -42,12 +42,12 @@ typedef enum ffi_abi {
FFI_V8,
FFI_V8PLUS,
FFI_V9,
+ FFI_LAST_ABI,
#ifdef SPARC64
- FFI_DEFAULT_ABI = FFI_V9,
+ FFI_DEFAULT_ABI = FFI_V9
#else
- FFI_DEFAULT_ABI = FFI_V8,
+ FFI_DEFAULT_ABI = FFI_V8
#endif
- FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
} ffi_abi;
#endif
diff --git a/src/x86/ffitarget.h b/src/x86/ffitarget.h
index b85016c..2738875 100644
--- a/src/x86/ffitarget.h
+++ b/src/x86/ffitarget.h
@@ -64,28 +64,29 @@ typedef enum ffi_abi {
#ifdef X86_WIN32
FFI_SYSV,
FFI_STDCALL,
+ FFI_LAST_ABI,
/* TODO: Add fastcall support for the sake of completeness */
- FFI_DEFAULT_ABI = FFI_SYSV,
+ FFI_DEFAULT_ABI = FFI_SYSV
#endif
#ifdef X86_WIN64
FFI_WIN64,
- FFI_DEFAULT_ABI = FFI_WIN64,
+ FFI_LAST_ABI,
+ FFI_DEFAULT_ABI = FFI_WIN64
#else
/* ---- Intel x86 and AMD x86-64 - */
#if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__) || defined(__i386) || defined(__amd64))
FFI_SYSV,
FFI_UNIX64, /* Unix variants all use the same ABI for x86-64 */
+ FFI_LAST_ABI,
#if defined(__i386__) || defined(__i386)
- FFI_DEFAULT_ABI = FFI_SYSV,
+ FFI_DEFAULT_ABI = FFI_SYSV
#else
- FFI_DEFAULT_ABI = FFI_UNIX64,
+ FFI_DEFAULT_ABI = FFI_UNIX64
#endif
#endif
#endif /* X86_WIN64 */
-
- FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
} ffi_abi;
#endif