Had a problem compiling transcode 1.0.4 on my OS X Tiger (PPC).
In file included from /usr/include/math.h:26,
from pvnglobals.h:26,
from pvn.h:15,
from import_pvn.c:39:
/usr/include/architecture/ppc/math.h:179: error: parse error before '__attribute__'
/usr/include/architecture/ppc/math.h:179: error: parse error before 'inline'
/usr/include/architecture/ppc/math.h:180: error: parse error before '__attribute__'
/usr/include/architecture/ppc/math.h:180: error: parse error before 'inline'
… and so forth. The whole math.h business is a red herring; or rather, it’s a symptom, not the cause.
The issue appears to stem from a preprocessor macro problem in src/transcode.h. Around line 85 or so, find the block
#ifndef always_inline
#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
# define always_inline __attribute__((always_inline)) inline
#else
# define always_inline inline
#endif
#endif
A rather odd and potentially problematic thing to do, because now in math.h:83, we note:
#define __MATH_H_ALWAYS_INLINE__ __attribute__ ((always_inline))
which later gets used in math.h:179, 180, and so forth.
Now, because of the first #define, it seems we’re likely to cause __MATH_H_ALWAYS_INLINE__ to become something like __attribute__((__attribute__ ((always_inline)) inline)). Unlikely to compile cleanly.
One possible solution is to swap around the header orders so that math.h is included before transcode.h clobbers the always_inline definition.
Another workaround: comment out in the inner #if and preserve only the else-branch in transcode.h:
#ifndef always_inline
# define always_inline inline
#endif
It fixes the compilation problem, presumably because it no longer causes the always_inline definition to conflict with the one in math.h. Unfortunately, it also changes the meaning of __attribute__ ((always_inline)) in math.h. The first solution is preferable, even though it might be more tedious to trace the include blowups that result.
The moral of the story is that it’s usually bad to screw with built-in keywords via preprocessor macros.