0001-Enable-build-for-different-c-libraries.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From 085ca40781f7c39febe6d14fb7e5cba342e1804b Mon Sep 17 00:00:00 2001
  2. From: Ricardo Crudo <ricardo.crudo@gmail.com>
  3. Date: Sat, 30 May 2020 22:03:01 +0200
  4. Subject: [PATCH] Enable build for different c libraries
  5. The open_memstream.c was using GLIBC macro definition to test if the
  6. library is building on a Linux box. This makes impossible to build
  7. tinycbor against other C libraries, as musl for example.
  8. Signed-off-by: Ricardo Crudo <ricardo.crudo@gmail.com>
  9. [Retrieved from:
  10. https://github.com/intel/tinycbor/commit/085ca40781f7c39febe6d14fb7e5cba342e1804b]
  11. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  12. ---
  13. src/open_memstream.c | 4 ++--
  14. 1 file changed, 2 insertions(+), 2 deletions(-)
  15. diff --git a/src/open_memstream.c b/src/open_memstream.c
  16. index 18f3de8..3365378 100644
  17. --- a/src/open_memstream.c
  18. +++ b/src/open_memstream.c
  19. @@ -38,7 +38,7 @@
  20. #ifdef __APPLE__
  21. typedef int RetType;
  22. typedef int LenType;
  23. -#elif __GLIBC__
  24. +#elif __linux__
  25. typedef ssize_t RetType;
  26. typedef size_t LenType;
  27. #else
  28. @@ -101,7 +101,7 @@ FILE *open_memstream(char **bufptr, size_t *lenptr)
  29. #ifdef __APPLE__
  30. return funopen(b, NULL, write_to_buffer, NULL, close_buffer);
  31. -#elif __GLIBC__
  32. +#elif __linux__
  33. static const cookie_io_functions_t vtable = {
  34. NULL,
  35. write_to_buffer,