From 304dbca63de29eeb7c1f932a8f2ef830f9f74411 Mon Sep 17 00:00:00 2001 From: Alexander Alashkin <alexander.alashkin@cesanta.com> Date: Fri, 9 Dec 2016 14:19:03 +0200 Subject: [PATCH] Fix miot-mbed errors and warning, part 3 PUBLISHED_FROM=2f6fb7ea5abdcd4ca9b06956172938ee3bc28459 --- mongoose.c | 2 +- mongoose.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mongoose.c b/mongoose.c index a3a620128..c500d2933 100644 --- a/mongoose.c +++ b/mongoose.c @@ -9485,7 +9485,7 @@ int mg_match_prefix(const char *pattern, int pattern_len, const char *str) { return mg_match_prefix_n(pstr, mg_mk_str(str)); } -MG_INTERNAL int mg_get_errno(void) { +DO_NOT_WARN_UNUSED MG_INTERNAL int mg_get_errno(void) { #ifndef WINCE return errno; #else diff --git a/mongoose.h b/mongoose.h index 0d829fc96..3bdfb0d23 100644 --- a/mongoose.h +++ b/mongoose.h @@ -129,11 +129,13 @@ #define NOINLINE __attribute__((noinline)) #define WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #define NOINSTR __attribute__((no_instrument_function)) +#define DO_NOT_WARN_UNUSED __attribute__((unused)) #else #define NORETURN #define NOINLINE #define WARN_UNUSED_RESULT #define NOINSTR +#define DO_NOT_WARN_UNUSED #endif /* __GNUC__ */ #ifndef ARRAY_SIZE @@ -883,6 +885,10 @@ typedef struct stat cs_stat_t; #include <stdint.h> #include <string.h> #include <time.h> +#include <sys/stat.h> +#include <stdio.h> + +typedef struct stat cs_stat_t; #ifndef CS_ENABLE_STDIO #define CS_ENABLE_STDIO 1 -- GitLab