-
Notifications
You must be signed in to change notification settings - Fork 201
Closed
Description
When trying to include tinycbor on ESP32 I got the below compile errors
Compiling .pio/build/hoverboard/lib24a/tinycbor/open_memstream.o
.pio/libdeps/hoverboard/tinycbor/src/open_memstream.c:45:4: error: #error "Cannot implement open_memstream!"
45 | # error "Cannot implement open_memstream!"
| ^~~~~
.pio/libdeps/hoverboard/tinycbor/src/open_memstream.c:57:8: error: unknown type name 'RetType'
57 | static RetType write_to_buffer(void *cookie, const char *data, LenType len)
| ^~~~~~~
.pio/libdeps/hoverboard/tinycbor/src/open_memstream.c:57:64: error: unknown type name 'LenType'
57 | static RetType write_to_buffer(void *cookie, const char *data, LenType len)
| ^~~~~~~
.pio/libdeps/hoverboard/tinycbor/src/open_memstream.c: In function 'open_memstream':
.pio/libdeps/hoverboard/tinycbor/src/open_memstream.c:113:1: error: control reaches end of non-void function [-Werror=return-type]
113 | }
| ^
.pio/libdeps/hoverboard/tinycbor/src/open_memstream.c: At top level:
.pio/libdeps/hoverboard/tinycbor/src/open_memstream.c:82:12: warning: 'close_buffer' defined but not used [-Wunused-function]
82 | static int close_buffer(void *cookie)
| ^~~~~~~~~~~~
cc1: some warnings being treated as errors
*** [.pio/build/hoverboard/lib24a/tinycbor/open_memstream.o] Error 1
the code limits the platforms , changing the elif linux to a generic else is sufficient to correct this.
Or is there an gcc cpp directive to avoid this ?
#ifdef __APPLE__
typedef int RetType;
typedef int LenType;
#elif __linux__
typedef ssize_t RetType;
typedef size_t LenType;
#else
# error "Cannot implement open_memstream!"
#endifMetadata
Metadata
Assignees
Labels
No labels