1 --- gcc-4.2.4.orig/gcc/toplev.h
2 +++ gcc-4.2.4/gcc/toplev.h
4 /* Return true iff flags are set as if -ffast-math. */
5 extern bool fast_math_flags_set_p (void);
7 +#if GCC_VERSION < 3004
8 /* Return log2, or -1 if not exact. */
9 extern int exact_log2 (unsigned HOST_WIDE_INT);
12 extern int floor_log2 (unsigned HOST_WIDE_INT);
14 /* Inline versions of the above for speed. */
15 -#if GCC_VERSION >= 3004
16 +#else /* GCC_VERSION >= 3004 */
17 # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
18 # define CLZ_HWI __builtin_clzl
19 # define CTZ_HWI __builtin_ctzl
21 # define CTZ_HWI __builtin_ctz
26 floor_log2 (unsigned HOST_WIDE_INT x)
28 return x ? HOST_BITS_PER_WIDE_INT - 1 - (int) CLZ_HWI (x) : -1;
33 exact_log2 (unsigned HOST_WIDE_INT x)
35 return x == (x & -x) && x ? (int) CTZ_HWI (x) : -1;
36 --- gcc-4.2.4.orig/gcc/toplev.c
37 +++ gcc-4.2.4/gcc/toplev.c
42 -/* When compiling with a recent enough GCC, we use the GNU C "extern inline"
43 - for floor_log2 and exact_log2; see toplev.h. That construct, however,
44 - conflicts with the ISO C++ One Definition Rule. */
46 -#if GCC_VERSION < 3004 || !defined (__cplusplus)
47 +#if GCC_VERSION < 3004
49 /* Given X, an unsigned number, return the largest int Y such that 2**Y <= X.
50 If X is 0, return -1. */