002-ctype.patch 622 B

123456789101112131415161718192021222324252627282930
  1. --- a/shared/Makefile
  2. +++ b/shared/Makefile
  3. @@ -19,7 +19,7 @@ LDFLAGS += -L.
  4. AR=ar
  5. RANLIB=ranlib
  6. -OBJS := shutils.o wl.o wl_linux.o linux_timer.o
  7. +OBJS := shutils.o wl.o wl_linux.o linux_timer.o ctype.o
  8. all: libshared.a
  9. clean:
  10. --- /dev/null
  11. +++ b/shared/ctype.c
  12. @@ -0,0 +1,16 @@
  13. +#include <features.h>
  14. +
  15. +#ifndef __UCLIBC__
  16. +extern void **__ctype_b_loc();
  17. +extern void **__ctype_tolower_loc();
  18. +
  19. +void *__ctype_b;
  20. +void *__ctype_tolower;
  21. +
  22. +static void init(void) __attribute__((constructor));
  23. +static void init(void)
  24. +{
  25. + __ctype_b = *__ctype_b_loc();
  26. + __ctype_tolower = *__ctype_tolower_loc();
  27. +}
  28. +#endif