mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-17 19:30:36 +00:00
Add automated check for extern "C"
Fix headers that didn't have it PUBLISHED_FROM=ce8140783d4b661f16278a4a5adc957b21965473
This commit is contained in:
1 parent
8bbb44f90c
commit
448b44094a
2 files changed
+46
-28
No files matched your search
+16
@@ -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,
|
|||||||
#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) {
|
|||||||
#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) {
|
|||||||
#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"
|
||||||
|
|||||||
+30
-28
@@ -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
|
||||||
|
|
||||||
@@ -603,7 +603,7 @@ typedef struct stat cs_stat_t;
|
|||||||
|
|
||||||
#include <simplelink.h>
|
#include <simplelink.h>
|
||||||
#include <netapp.h>
|
#include <netapp.h>
|
||||||
#undef timeval
|
#undef timeval
|
||||||
|
|
||||||
typedef int sock_t;
|
typedef int sock_t;
|
||||||
#define INVALID_SOCKET (-1)
|
#define INVALID_SOCKET (-1)
|
||||||
@@ -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;
|
|||||||
#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
|
||||||
@@ -1014,16 +1015,16 @@ in_addr_t inet_addr(const char *cp);
|
|||||||
|
|
||||||
#define to64(x) strtoll(x, NULL, 10)
|
#define to64(x) strtoll(x, NULL, 10)
|
||||||
|
|
||||||
#define MG_NET_IF MG_NET_IF_LWIP_LOW_LEVEL
|
#define MG_NET_IF MG_NET_IF_LWIP_LOW_LEVEL
|
||||||
#define MG_LWIP 1
|
#define MG_LWIP 1
|
||||||
#define MG_ENABLE_IPV6 1
|
#define MG_ENABLE_IPV6 1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For ARM C Compiler, make lwip to export `struct timeval`; for other
|
* For ARM C Compiler, make lwip to export `struct timeval`; for other
|
||||||
* 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);
|
||||||
@@ -1060,12 +1061,12 @@ int gettimeofday(struct timeval *tp, void *tzp);
|
|||||||
|
|
||||||
#define to64(x) strtoll(x, NULL, 10)
|
#define to64(x) strtoll(x, NULL, 10)
|
||||||
|
|
||||||
#define MG_NET_IF MG_NET_IF_LWIP_LOW_LEVEL
|
#define MG_NET_IF MG_NET_IF_LWIP_LOW_LEVEL
|
||||||
#define MG_LWIP 1
|
#define MG_LWIP 1
|
||||||
#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);
|
|||||||
* 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 {
|
|||||||
#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;
|
|||||||
#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;
|
|||||||
#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);
|
|||||||
|
|
||||||
#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);
|
|||||||
|
|
||||||
#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
|
||||||
|
|||||||
Reference in new issue
Block a user