844-gcc-fix-build-with-gcc5.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From 4fb4acf88912dd978bb63ecab79641a5795ce84f Mon Sep 17 00:00:00 2001
  2. From: Romain Naour <romain.naour@openwide.fr>
  3. Date: Mon, 27 Jul 2015 15:05:14 +0200
  4. Subject: [PATCH] gcc: fix build with gcc5
  5. gcc < 4.8 doesn't build with gcc5.
  6. Patch is from DragonFlyBSD github [1]
  7. [1] https://github.com/DragonFlyBSD/DPorts/issues/136
  8. Signed-off-by: Romain Naour <romain.naour@openwide.fr>
  9. ---
  10. gcc/cp/cfns.h | 5 ++++-
  11. 1 file changed, 4 insertions(+), 1 deletion(-)
  12. diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
  13. index 62cdfab..4f63cc4 100644
  14. --- a/gcc/cp/cfns.h
  15. +++ b/gcc/cp/cfns.h
  16. @@ -53,6 +53,9 @@ __inline
  17. static unsigned int hash (const char *, unsigned int);
  18. #ifdef __GNUC__
  19. __inline
  20. +#ifdef __GNUC_STDC_INLINE__
  21. +__attribute__ ((__gnu_inline__))
  22. +#endif
  23. #endif
  24. const char * libc_name_p (const char *, unsigned int);
  25. /* maximum key range = 391, duplicates = 0 */
  26. @@ -96,7 +99,7 @@ hash (register const char *str, register unsigned int len)
  27. 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  28. 400, 400, 400, 400, 400, 400, 400
  29. };
  30. - register int hval = len;
  31. + register int hval = (int)len;
  32. switch (hval)
  33. {
  34. --
  35. 2.4.3