fix-compile-with-newer-gcc.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. diff -Nur gcc-4.4.7.orig/gcc/toplev.h gcc-4.4.7/gcc/toplev.h
  2. --- gcc-4.4.7.orig/gcc/toplev.h 2009-02-20 16:20:38.000000000 +0100
  3. +++ gcc-4.4.7/gcc/toplev.h 2017-06-30 21:00:00.981033517 +0200
  4. @@ -167,38 +167,6 @@
  5. extern bool fast_math_flags_set_p (void);
  6. extern bool fast_math_flags_struct_set_p (struct cl_optimization *);
  7. -/* Return log2, or -1 if not exact. */
  8. -extern int exact_log2 (unsigned HOST_WIDE_INT);
  9. -
  10. -/* Return floor of log2, with -1 for zero. */
  11. -extern int floor_log2 (unsigned HOST_WIDE_INT);
  12. -
  13. -/* Inline versions of the above for speed. */
  14. -#if GCC_VERSION >= 3004
  15. -# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
  16. -# define CLZ_HWI __builtin_clzl
  17. -# define CTZ_HWI __builtin_ctzl
  18. -# elif HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONGLONG
  19. -# define CLZ_HWI __builtin_clzll
  20. -# define CTZ_HWI __builtin_ctzll
  21. -# else
  22. -# define CLZ_HWI __builtin_clz
  23. -# define CTZ_HWI __builtin_ctz
  24. -# endif
  25. -
  26. -extern inline int
  27. -floor_log2 (unsigned HOST_WIDE_INT x)
  28. -{
  29. - return x ? HOST_BITS_PER_WIDE_INT - 1 - (int) CLZ_HWI (x) : -1;
  30. -}
  31. -
  32. -extern inline int
  33. -exact_log2 (unsigned HOST_WIDE_INT x)
  34. -{
  35. - return x == (x & -x) && x ? (int) CTZ_HWI (x) : -1;
  36. -}
  37. -#endif /* GCC_VERSION >= 3004 */
  38. -
  39. /* Functions used to get and set GCC's notion of in what directory
  40. compilation was started. */