Commit 448b4409 authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by Cesanta Bot

Add automated check for extern "C"

Fix headers that didn't have it

PUBLISHED_FROM=ce8140783d4b661f16278a4a5adc957b21965473
parent 8bbb44f9
...@@ -165,6 +165,10 @@ MG_INTERNAL int mg_sntp_parse_reply(const char *buf, int len, ...@@ -165,6 +165,10 @@ MG_INTERNAL int mg_sntp_parse_reply(const char *buf, int len,
#ifndef CS_COMMON_MG_MEM_H_ #ifndef CS_COMMON_MG_MEM_H_
#define CS_COMMON_MG_MEM_H_ #define CS_COMMON_MG_MEM_H_
#ifdef __cplusplus
extern "C" {
#endif
#ifndef MG_MALLOC #ifndef MG_MALLOC
#define MG_MALLOC malloc #define MG_MALLOC malloc
#endif #endif
...@@ -181,6 +185,10 @@ MG_INTERNAL int mg_sntp_parse_reply(const char *buf, int len, ...@@ -181,6 +185,10 @@ MG_INTERNAL int mg_sntp_parse_reply(const char *buf, int len,
#define MG_FREE free #define MG_FREE free
#endif #endif
#ifdef __cplusplus
}
#endif
#endif /* CS_COMMON_MG_MEM_H_ */ #endif /* CS_COMMON_MG_MEM_H_ */
#ifdef MG_MODULE_LINES #ifdef MG_MODULE_LINES
#line 1 "common/cs_dbg.h" #line 1 "common/cs_dbg.h"
...@@ -782,6 +790,10 @@ double cs_time(void) { ...@@ -782,6 +790,10 @@ double cs_time(void) {
#ifndef CS_COMMON_CS_ENDIAN_H_ #ifndef CS_COMMON_CS_ENDIAN_H_
#define CS_COMMON_CS_ENDIAN_H_ #define CS_COMMON_CS_ENDIAN_H_
#ifdef __cplusplus
extern "C" {
#endif
/* /*
* clang with std=-c99 uses __LITTLE_ENDIAN, by default * clang with std=-c99 uses __LITTLE_ENDIAN, by default
* while for ex, RTOS gcc - LITTLE_ENDIAN, by default * while for ex, RTOS gcc - LITTLE_ENDIAN, by default
...@@ -797,6 +809,10 @@ double cs_time(void) { ...@@ -797,6 +809,10 @@ double cs_time(void) {
#endif /* BIG_ENDIAN */ #endif /* BIG_ENDIAN */
#endif /* BYTE_ORDER */ #endif /* BYTE_ORDER */
#ifdef __cplusplus
}
#endif
#endif /* CS_COMMON_CS_ENDIAN_H_ */ #endif /* CS_COMMON_CS_ENDIAN_H_ */
#ifdef MG_MODULE_LINES #ifdef MG_MODULE_LINES
#line 1 "common/cs_md5.c" #line 1 "common/cs_md5.c"
......
...@@ -560,9 +560,9 @@ typedef struct stat cs_stat_t; ...@@ -560,9 +560,9 @@ typedef struct stat cs_stat_t;
#ifndef MG_NET_IF #ifndef MG_NET_IF
#include <lwip/opt.h> #include <lwip/opt.h>
#if LWIP_SOCKET /* RTOS SDK has LWIP sockets */ #if LWIP_SOCKET /* RTOS SDK has LWIP sockets */
# define MG_NET_IF MG_NET_IF_SOCKET #define MG_NET_IF MG_NET_IF_SOCKET
#else #else
# define MG_NET_IF MG_NET_IF_LWIP_LOW_LEVEL #define MG_NET_IF MG_NET_IF_LWIP_LOW_LEVEL
#endif #endif
#endif #endif
...@@ -840,7 +840,8 @@ int _stat(const char *pathname, struct stat *st); ...@@ -840,7 +840,8 @@ int _stat(const char *pathname, struct stat *st);
#define CS_ENABLE_STDIO 1 #define CS_ENABLE_STDIO 1
#endif #endif
#if (defined(CC3200_FS_SPIFFS) || defined(CC3200_FS_SLFS)) && !defined(MG_ENABLE_FILESYSTEM) #if (defined(CC3200_FS_SPIFFS) || defined(CC3200_FS_SLFS)) && \
!defined(MG_ENABLE_FILESYSTEM)
#define MG_ENABLE_FILESYSTEM 1 #define MG_ENABLE_FILESYSTEM 1
#endif #endif
...@@ -884,15 +885,15 @@ typedef struct stat cs_stat_t; ...@@ -884,15 +885,15 @@ typedef struct stat cs_stat_t;
#define __cdecl #define __cdecl
#ifndef MG_NET_IF #ifndef MG_NET_IF
# include <lwip/opt.h> #include <lwip/opt.h>
# if LWIP_SOCKET #if LWIP_SOCKET
# define MG_NET_IF MG_NET_IF_SOCKET #define MG_NET_IF MG_NET_IF_SOCKET
# else #else
# define MG_NET_IF MG_NET_IF_LWIP_LOW_LEVEL #define MG_NET_IF MG_NET_IF_LWIP_LOW_LEVEL
# endif #endif
# define MG_LWIP 1 #define MG_LWIP 1
#elif MG_NET_IF == MG_NET_IF_SIMPLELINK #elif MG_NET_IF == MG_NET_IF_SIMPLELINK
# include "common/platforms/simplelink/cs_simplelink.h" /* Amalgamated: #include "common/platforms/simplelink/cs_simplelink.h" */
#endif #endif
#ifndef CS_ENABLE_STDIO #ifndef CS_ENABLE_STDIO
...@@ -1023,7 +1024,7 @@ in_addr_t inet_addr(const char *cp); ...@@ -1023,7 +1024,7 @@ in_addr_t inet_addr(const char *cp);
* compilers, suppress it. * compilers, suppress it.
*/ */
#if !defined(__ARMCC_VERSION) #if !defined(__ARMCC_VERSION)
# define LWIP_TIMEVAL_PRIVATE 0 #define LWIP_TIMEVAL_PRIVATE 0
#else #else
struct timeval; struct timeval;
int gettimeofday(struct timeval *tp, void *tzp); int gettimeofday(struct timeval *tp, void *tzp);
...@@ -1065,7 +1066,7 @@ int gettimeofday(struct timeval *tp, void *tzp); ...@@ -1065,7 +1066,7 @@ int gettimeofday(struct timeval *tp, void *tzp);
#define MG_ENABLE_IPV6 1 #define MG_ENABLE_IPV6 1
#if !defined(ENOSPC) #if !defined(ENOSPC)
# define ENOSPC 28 /* No space left on device */ #define ENOSPC 28 /* No space left on device */
#endif #endif
/* /*
...@@ -1073,7 +1074,7 @@ int gettimeofday(struct timeval *tp, void *tzp); ...@@ -1073,7 +1074,7 @@ int gettimeofday(struct timeval *tp, void *tzp);
* compilers, suppress it. * compilers, suppress it.
*/ */
#if !defined(__ARMCC_VERSION) #if !defined(__ARMCC_VERSION)
# define LWIP_TIMEVAL_PRIVATE 0 #define LWIP_TIMEVAL_PRIVATE 0
#endif #endif
#define INT64_FMT PRId64 #define INT64_FMT PRId64
...@@ -1377,18 +1378,18 @@ typedef struct _stati64 { ...@@ -1377,18 +1378,18 @@ typedef struct _stati64 {
#endif #endif
#ifndef _UINTPTR_T_DEFINED #ifndef _UINTPTR_T_DEFINED
typedef unsigned int* uintptr_t; typedef unsigned int *uintptr_t;
#endif #endif
#define _S_IFREG 2 #define _S_IFREG 2
#define _S_IFDIR 4 #define _S_IFDIR 4
#ifndef S_ISDIR #ifndef S_ISDIR
#define S_ISDIR(x) (((x) & _S_IFDIR) != 0) #define S_ISDIR(x) (((x) &_S_IFDIR) != 0)
#endif #endif
#ifndef S_ISREG #ifndef S_ISREG
#define S_ISREG(x) (((x) & _S_IFREG) != 0) #define S_ISREG(x) (((x) &_S_IFREG) != 0)
#endif #endif
int open(const char *filename, int oflag, int pmode); int open(const char *filename, int oflag, int pmode);
...@@ -1425,7 +1426,8 @@ typedef struct stat cs_stat_t; ...@@ -1425,7 +1426,8 @@ typedef struct stat cs_stat_t;
#define MG_NET_IF MG_NET_IF_LWIP_LOW_LEVEL #define MG_NET_IF MG_NET_IF_LWIP_LOW_LEVEL
/* /*
* LPCXpress comes with 3 C library implementations: Newlib, NewlibNano and Redlib. * LPCXpress comes with 3 C library implementations: Newlib, NewlibNano and
*Redlib.
* See https://community.nxp.com/message/630860 for more details. * See https://community.nxp.com/message/630860 for more details.
* *
* Redlib is the default and lacks certain things, so we provide them. * Redlib is the default and lacks certain things, so we provide them.
...@@ -1521,7 +1523,7 @@ typedef TCP_SOCKET sock_t; ...@@ -1521,7 +1523,7 @@ typedef TCP_SOCKET sock_t;
#define CS_ENABLE_STDIO 1 #define CS_ENABLE_STDIO 1
#endif #endif
char* inet_ntoa(struct in_addr in); char *inet_ntoa(struct in_addr in);
#endif /* CS_PLATFORM == CS_P_PIC32 */ #endif /* CS_PLATFORM == CS_P_PIC32 */
...@@ -1759,7 +1761,7 @@ double cs_time(void); ...@@ -1759,7 +1761,7 @@ double cs_time(void);
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif /* __cplusplus */ #endif
/* Describes chunk of memory */ /* Describes chunk of memory */
struct mg_str { struct mg_str {
...@@ -1813,7 +1815,7 @@ const char *mg_strstr(const struct mg_str haystack, const struct mg_str needle); ...@@ -1813,7 +1815,7 @@ const char *mg_strstr(const struct mg_str haystack, const struct mg_str needle);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif
#endif /* CS_COMMON_MG_STR_H_ */ #endif /* CS_COMMON_MG_STR_H_ */
#ifdef MG_MODULE_LINES #ifdef MG_MODULE_LINES
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment