diff --git a/mongoose.c b/mongoose.c index acab8e09..916c8ca3 100644 --- a/mongoose.c +++ b/mongoose.c @@ -3254,15 +3254,18 @@ void mg_timer_poll(unsigned long now_ms) { + #include #include // Different versions have those in different files, so declare here +#ifndef EXTERN_C #ifdef __cplusplus #define EXTERN_C extern "C" #else #define EXTERN_C #endif +#endif EXTERN_C int mbedtls_net_recv(void *, unsigned char *, size_t); EXTERN_C int mbedtls_net_send(void *, const unsigned char *, size_t); diff --git a/mongoose.h b/mongoose.h index c5566732..41f8b01b 100644 --- a/mongoose.h +++ b/mongoose.h @@ -228,8 +228,11 @@ static inline int ff_vfprintf(FF_FILE *fp, const char *fmt, va_list ap) { typedef __int64 int64_t; typedef unsigned __int64 uint64_t; typedef unsigned char uint8_t; +typedef char int8_t; typedef unsigned short uint16_t; +typedef short int16_t; typedef unsigned int uint32_t; +typedef int int32_t; typedef int bool; enum { false = 0, true = 1 }; #else diff --git a/src/arch_win32.h b/src/arch_win32.h index 8351c157..ae0e0e54 100644 --- a/src/arch_win32.h +++ b/src/arch_win32.h @@ -7,8 +7,11 @@ typedef __int64 int64_t; typedef unsigned __int64 uint64_t; typedef unsigned char uint8_t; +typedef char int8_t; typedef unsigned short uint16_t; +typedef short int16_t; typedef unsigned int uint32_t; +typedef int int32_t; typedef int bool; enum { false = 0, true = 1 }; #else diff --git a/src/tls.c b/src/tls.c index 08342b7a..d8e102ce 100644 --- a/src/tls.c +++ b/src/tls.c @@ -9,11 +9,13 @@ #include // Different versions have those in different files, so declare here +#ifndef EXTERN_C #ifdef __cplusplus #define EXTERN_C extern "C" #else #define EXTERN_C #endif +#endif EXTERN_C int mbedtls_net_recv(void *, unsigned char *, size_t); EXTERN_C int mbedtls_net_send(void *, const unsigned char *, size_t);