diff options
author | Anthony Green <green@moxielogic.com> | 2011-02-08 10:19:19 -0500 |
---|---|---|
committer | Anthony Green <green@moxielogic.com> | 2011-02-08 10:19:19 -0500 |
commit | 89284fe55f1a8ad3bddbea796ee00d0e3ba411ce (patch) | |
tree | c15225662e0ebc33e5863117587062f782dfca79 /include | |
parent | ba022c338af97cb18d9f8ed5a607fd483a61c09c (diff) | |
download | libffi-89284fe55f1a8ad3bddbea796ee00d0e3ba411ce.tar.gz |
Fix AIX build with IBM XLC
Diffstat (limited to 'include')
-rw-r--r-- | include/ffi.h.in | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/include/ffi.h.in b/include/ffi.h.in index 92e38c4..18ced12 100644 --- a/include/ffi.h.in +++ b/include/ffi.h.in @@ -1,16 +1,17 @@ /* -----------------------------------------------------------------*-C-*- - libffi @VERSION@ - Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc. + libffi @VERSION@ - Copyright (c) 2011 Anthony Green + - Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc. - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - ``Software''), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the ``Software''), to deal in the Software without + restriction, including without limitation the rights to use, copy, + modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF @@ -77,6 +78,9 @@ extern "C" { /* LONG_LONG_MAX is not always defined (not if STRICT_ANSI, for example). But we can find it either under the correct ANSI name, or under GNU C's internal name. */ + +#define FFI_64_BIT_MAX 9223372036854775807 + #ifdef LONG_LONG_MAX # define FFI_LONG_LONG_MAX LONG_LONG_MAX #else @@ -86,6 +90,15 @@ extern "C" { # ifdef __GNUC__ # define FFI_LONG_LONG_MAX __LONG_LONG_MAX__ # endif +# ifdef _AIX +# ifndef __PPC64__ +# if defined (__IBMC__) || defined (__IBMCPP__) +# define FFI_LONG_LONG_MAX LONGLONG_MAX +# endif +# endif /* __PPC64__ */ +# undef FFI_64_BIT_MAX +# define FFI_64_BIT_MAX 9223372036854775807LL +# endif # endif #endif @@ -132,17 +145,17 @@ typedef struct _ffi_type #endif #if LONG_MAX == 2147483647 -# if FFI_LONG_LONG_MAX != 9223372036854775807 +# if FFI_LONG_LONG_MAX != FFI_64_BIT_MAX #error "no 64-bit data type supported" # endif -#elif LONG_MAX != 9223372036854775807 +#elif LONG_MAX != FFI_64_BIT_MAX #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 +#elif LONG_MAX == FFI_64_BIT_MAX # define ffi_type_ulong ffi_type_uint64 # define ffi_type_slong ffi_type_sint64 #else @@ -195,7 +208,7 @@ typedef struct { #ifndef FFI_SIZEOF_ARG # if LONG_MAX == 2147483647 # define FFI_SIZEOF_ARG 4 -# elif LONG_MAX == 9223372036854775807 +# elif LONG_MAX == FFI_64_BIT_MAX # define FFI_SIZEOF_ARG 8 # endif #endif |