summaryrefslogtreecommitdiff
path: root/libffi/include
diff options
context:
space:
mode:
authorandreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4>2006-07-25 20:01:22 +0000
committerandreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4>2006-07-25 20:01:22 +0000
commitc695c02415c38d26c98d352e228cc348849819ac (patch)
tree75a10258420b179909b785eb7bb52eb01ba11601 /libffi/include
parentf68513d3a28b383ef34f7f65d90399436b9f57cd (diff)
downloadgcc-c695c02415c38d26c98d352e228cc348849819ac.tar.gz
2006-07-25 Torsten Schoenfeld <kaffeetisch@gmx.de>
* include/ffi.h.in (ffi_type_ulong, ffi_type_slong): Define correctly for 32-bit architectures. * testsuite/libffi.call/return_ul.c: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115739 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libffi/include')
-rw-r--r--libffi/include/ffi.h.in14
1 files changed, 11 insertions, 3 deletions
diff --git a/libffi/include/ffi.h.in b/libffi/include/ffi.h.in
index 42600458689..f6f6e1a2e10 100644
--- a/libffi/include/ffi.h.in
+++ b/libffi/include/ffi.h.in
@@ -112,16 +112,24 @@ extern "C" {
#error "int size not supported"
#endif
-#define ffi_type_ulong ffi_type_uint64
-#define ffi_type_slong ffi_type_sint64
#if LONG_MAX == 2147483647
# if FFI_LONG_LONG_MAX != 9223372036854775807
- #error "no 64-bit data type supported"
+ #error "no 64-bit data type supported"
# endif
#elif LONG_MAX != 9223372036854775807
#error "long size not supported"
#endif
+#if LONG_MAX == 2147483647
+# define ffi_type_ulong ffi_type_uint32
+# define ffi_type_slong ffi_type_sint32
+#elif LONG_MAX == 9223372036854775807
+# define ffi_type_ulong ffi_type_uint64
+# define ffi_type_slong ffi_type_sint64
+#else
+ #error "long size not supported"
+#endif
+
/* The closure code assumes that this works on pointers, i.e. a size_t */
/* can hold a pointer. */