020-musl-fixes.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. --- a/shared/wl_linux.c
  2. +++ b/shared/wl_linux.c
  3. @@ -13,6 +13,7 @@
  4. */
  5. #include <stdio.h>
  6. +#include <stdint.h>
  7. #include <unistd.h>
  8. #include <string.h>
  9. #include <errno.h>
  10. @@ -20,10 +21,10 @@
  11. #include <net/if.h>
  12. #include <linux/types.h>
  13. -typedef u_int64_t u64;
  14. -typedef u_int32_t u32;
  15. -typedef u_int16_t u16;
  16. -typedef u_int8_t u8;
  17. +typedef uint64_t u64;
  18. +typedef uint32_t u32;
  19. +typedef uint16_t u16;
  20. +typedef uint8_t u8;
  21. #include <linux/sockios.h>
  22. #include <linux/ethtool.h>
  23. --- a/shared/linux_timer.c
  24. +++ b/shared/linux_timer.c
  25. @@ -125,7 +125,7 @@ void unblock_timer();
  26. static struct event *event_queue = NULL;
  27. static struct event *event_freelist;
  28. -static uint g_granularity;
  29. +static unsigned int g_granularity;
  30. static int g_maxevents = 0;
  31. uclock_t uclock()
  32. --- a/shared/wl.c
  33. +++ b/shared/wl.c
  34. @@ -14,6 +14,7 @@
  35. #include <typedefs.h>
  36. #include <string.h>
  37. #include <stdio.h>
  38. +#include <stdlib.h>
  39. #include <unistd.h>
  40. #include <errno.h>
  41. #include <sys/ioctl.h>
  42. @@ -263,3 +264,28 @@ wl_printlasterror(char *name)
  43. fprintf(stderr, err_buf);
  44. }
  45. */
  46. +
  47. +static int in_assert; /* bss inits to 0. */
  48. +
  49. +void __assert(const char *assertion, const char * filename,
  50. + unsigned int linenumber, register const char * function)
  51. +{
  52. + if (!in_assert) {
  53. + in_assert = 1;
  54. +
  55. + fprintf(stderr,
  56. +#ifdef ASSERT_SHOW_PROGNAME
  57. + "%s: %s: %d: %s: Assertion `%s' failed.\n", __uclibc_progname,
  58. +#else
  59. + "%s: %d: %s: Assertion `%s' failed.\n",
  60. +#endif
  61. + filename,
  62. + linenumber,
  63. + /* Function name isn't available with some compilers. */
  64. + ((function == NULL) ? "?function?" : function),
  65. + assertion
  66. + );
  67. + }
  68. + /* shouldn't we? fflush(stderr); */
  69. + abort();
  70. +}