macosx extern inline problem

Torbjorn Granlund tg at
Tue May 25 08:13:22 CEST 2010

Jay K <jay.krell at> writes:

  This is the default gcc with MacOSX 10.5/x86. I think it is worth trying a
  There is seemingly just one problem, here is a fix:
  #ifdef __GNUC__
  > /* Apple gcc 4.0.1 -std=gnu99 has problems, worked around here. */
  > #if defined __GNUC_STDC_INLINE__ && defined __APPLE__ && __GNUC__ == 4
  && __GNUC_MINOR__ == 0
  > #define __GMP_EXTERN_INLINE      __inline__
  > #define __GMP_INLINE_PROTOTYPES  0
  > #else
  #if (defined __GNUC_STDC_INLINE__) || (__GNUC__ == 4 && __GNUC_MINOR__ ==
  #define __GMP_EXTERN_INLINE extern __inline__ __attribute__
  #define __GMP_EXTERN_INLINE      extern __inline__
  > #endif
As I said before, we chose not to work around every Xcode quirk, since
there are too many, and the result would be that GMP would become harder
to maintain.  The workaround is instead to use a different Xcode.

(You should remember that Apple machines is just one of many dozens of
platforms we support.  Imagine the mess we would create if we tried to
handle every odd behaviour in each toolchain of each platform!)

  It sounds like if you kept everything in C and accepted the default PIC,
  many problems would go away?

What does "default PIC" mean?

I believe our asm PIC code now is accepted by any Xcode from the last 5

  "Keeping everything in C", the use of "none" above, is what the gcc build
  does when it builds gmp.
Very wise of them.  They don't need the speed of the assembly code.


More information about the gmp-discuss mailing list