mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-02 12:49:03 +00:00
Update the TinyCBOR serialization library to the latest 0.6.1 tagged release. Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
33 lines
952 B
Diff
33 lines
952 B
Diff
diff --git a/tinycbor/open_memstream.c b/tinycbor/open_memstream.c
|
|
index 3365378..37a0d08 100644
|
|
--- a/tinycbor/open_memstream.c
|
|
+++ b/tinycbor/open_memstream.c
|
|
@@ -32,13 +32,13 @@
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
-#if defined(__unix__) || defined(__APPLE__)
|
|
+#if defined(__unix__) || defined(__APPLE__) || defined(__NuttX__)
|
|
# include <unistd.h>
|
|
#endif
|
|
-#ifdef __APPLE__
|
|
+#if defined(__APPLE__)
|
|
typedef int RetType;
|
|
typedef int LenType;
|
|
-#elif __linux__
|
|
+#elif defined(__linux__) || defined(__NuttX__)
|
|
typedef ssize_t RetType;
|
|
typedef size_t LenType;
|
|
#else
|
|
@@ -99,9 +99,9 @@ FILE *open_memstream(char **bufptr, size_t *lenptr)
|
|
*bufptr = NULL;
|
|
*lenptr = 0;
|
|
|
|
-#ifdef __APPLE__
|
|
+#if defined(__APPLE__)
|
|
return funopen(b, NULL, write_to_buffer, NULL, close_buffer);
|
|
-#elif __linux__
|
|
+#elif defined(__linux__) || defined(__NuttX__)
|
|
static const cookie_io_functions_t vtable = {
|
|
NULL,
|
|
write_to_buffer,
|