mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-27 06:51:04 +08:00
Fix #1305 - add #ifdef __cplusplus for C++ linkage
This commit is contained in:
parent
f46453f80f
commit
015586950f
4
Makefile
4
Makefile
@ -47,7 +47,7 @@ mg_prefix: mongoose.c mongoose.h
|
||||
# C++ build
|
||||
test++: CLANG = g++
|
||||
test++: WARN += -Wno-shadow -Wno-missing-field-initializers -Wno-deprecated
|
||||
test++: unamalgamated
|
||||
test++: test
|
||||
|
||||
# Make sure we can build from an unamalgamated sources
|
||||
unamalgamated: $(SRCS) $(HDRS) Makefile
|
||||
@ -108,7 +108,7 @@ mongoose.c: $(SRCS) Makefile
|
||||
(cat src/license.h; echo; echo '#include "mongoose.h"' ; (for F in src/private.h src/*.c ; do echo; echo '#ifdef MG_ENABLE_LINES'; echo "#line 1 \"$$F\""; echo '#endif'; cat $$F | sed -e 's,#include ".*,,'; done))> $@
|
||||
|
||||
mongoose.h: $(HDRS) Makefile
|
||||
(cat src/license.h src/version.h ; cat src/arch.h src/arch_*.h src/config.h src/str.h src/log.h src/timer.h src/util.h src/url.h src/iobuf.h src/base64.h src/md5.h src/sha1.h src/event.h src/net.h src/http.h src/ssi.h src/tls.h src/ws.h src/sntp.h src/mqtt.h src/dns.h | sed -e 's,#include ".*,,' -e 's,^#pragma once,,')> $@
|
||||
(cat src/license.h src/version.h ; cat src/arch.h src/arch_*.h src/config.h src/str.h src/log.h src/timer.h src/util.h src/url.h src/iobuf.h src/base64.h src/md5.h src/sha1.h src/event.h src/net.h src/http.h src/ssi.h src/tls.h src/ws.h src/sntp.h src/mqtt.h src/dns.h | sed -e 's,#include ".*,,' -e 's,^#pragma once,,'; echo; echo '#ifdef __cplusplus'; echo '}'; echo '#endif')> $@
|
||||
|
||||
clean: EXAMPLE_TARGET = clean
|
||||
clean: ex
|
||||
|
@ -17,6 +17,10 @@
|
||||
#pragma once
|
||||
#define MG_VERSION "7.3"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#define MG_ARCH_CUSTOM 0
|
||||
#define MG_ARCH_UNIX 1
|
||||
@ -959,3 +963,7 @@ bool mg_dns_parse(const uint8_t *buf, size_t len, struct mg_dns_message *);
|
||||
size_t mg_dns_parse_rr(const uint8_t *buf, size_t len, size_t ofs,
|
||||
bool is_question, struct mg_dns_rr *);
|
||||
size_t mg_dns_decode_name(const uint8_t *, size_t, size_t, char *, size_t);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -1,2 +1,6 @@
|
||||
#pragma once
|
||||
#define MG_VERSION "7.3"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user