diff --git a/src/gmp/gmp-h.in b/src/gmp/gmp-h.in index b5581d848..8a70b1e25 100644 --- a/src/gmp/gmp-h.in +++ b/src/gmp/gmp-h.in @@ -419,11 +419,28 @@ typedef __mpq_struct *mpq_ptr; /* gcc has __inline__ in all modes, including strict ansi. Give a prototype for an inline too, so as to correctly specify "dllimport" on windows, in case the function is called rather than inlined. */ + #ifdef __GNUC__ -#define __GMP_EXTERN_INLINE extern __inline__ +#if defined(__APPLE_CC__) && (__APPLE_CC__ != 1) /* FSF GCC sets this flag to 1\ + on Apple machines */ + +#if ! (__APPLE_CC__ >= 5465 && __STDC_VERSION__ >= 199901L) +#define __GMP_EXTERN_INLINE extern __inline__ #define __GMP_INLINE_PROTOTYPES 1 #endif +#else /*GNU CC*/ + +#if defined(__GNUC_STDC_INLINE__) || defined (__GNUC_GNU_INLINE__) +#define __GMP_EXTERN_INLINE extern __inline__ __attribute__((__gnu_inline__)) +#else +#define __GMP_EXTERN_INLINE extern __inline__ +#endif +#define __GMP_INLINE_PROTOTYPES 1 + +#endif +#endif + /* DEC C (eg. version 5.9) supports "static __inline foo()", even in -std1 strict ANSI mode. Inlining is done even when not optimizing (ie. -O0 mode, which is the default), but an unnecessary local copy of foo is