0001-mingw_fixes-don-t-redefine-strchrnul-for-unix-system.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From 1c64c2d103c9356750a3d3b559068329bb0c7e3c Mon Sep 17 00:00:00 2001
  2. From: Romain Naour <romain.naour@openwide.fr>
  3. Date: Fri, 20 Feb 2015 00:29:47 +0100
  4. Subject: [PATCH] mingw_fixes: don't redefine strchrnul for unix system
  5. On bfin architecture all symbols are prefixed with a underscore '_', hence a
  6. conflict with the _strchrnul symbole from mingw_fixes.c and the one from uClibc.
  7. Path/to/sysroot/usr/lib/libc.a(strchrnul.o): In function `*___GI_strchrnul':
  8. Path/to/uClibc/libc/string/generic/strchrnul.c:33: multiple definition of `_strchrnul'
  9. obj/mingw_fixes.o:src/mingw_fixes.c:(.text+0x0): first defined here
  10. Since mingw_fixes.c is intended for WIN32 system, add a guard around strchrnul function
  11. and use the one defined from string.h.
  12. Fixes:
  13. http://autobuild.buildroot.net/results/a08/a085fb55269971e3c7b8ae8c167e7330c3c042a5/
  14. Signed-off-by: Romain Naour <romain.naour@openwide.fr>
  15. ---
  16. src/mingw_fixes.c | 2 ++
  17. 1 file changed, 2 insertions(+)
  18. diff --git a/src/mingw_fixes.c b/src/mingw_fixes.c
  19. index d734438..2f4069e 100644
  20. --- a/src/mingw_fixes.c
  21. +++ b/src/mingw_fixes.c
  22. @@ -18,9 +18,11 @@
  23. */
  24. #include "mingw_fixes.h"
  25. +#ifndef TARGET_UNIX
  26. char *strchrnul( const char *s, int c )
  27. {
  28. for (; *s != c && *s != '\0'; ++s)
  29. ;
  30. return (char *)s;
  31. }
  32. +#endif
  33. --
  34. 1.9.3