Skip to content

Commit

Permalink
Enable build for different c libraries
Browse files Browse the repository at this point in the history
The open_memstream.c was using GLIBC macro definition to test if the
library is building on a Linux box. This makes impossible to build
tinycbor against other C libraries, as musl for example.

Signed-off-by: Ricardo Crudo <ricardo.crudo@gmail.com>
  • Loading branch information
odurc authored and thiagomacieira committed Jun 1, 2020
1 parent e608465 commit 085ca40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/open_memstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#ifdef __APPLE__
typedef int RetType;
typedef int LenType;
#elif __GLIBC__
#elif __linux__
typedef ssize_t RetType;
typedef size_t LenType;
#else
Expand Down Expand Up @@ -101,7 +101,7 @@ FILE *open_memstream(char **bufptr, size_t *lenptr)

#ifdef __APPLE__
return funopen(b, NULL, write_to_buffer, NULL, close_buffer);
#elif __GLIBC__
#elif __linux__
static const cookie_io_functions_t vtable = {
NULL,
write_to_buffer,
Expand Down

0 comments on commit 085ca40

Please sign in to comment.