Fix #1305 - add #ifdef __cplusplus for C++ linkage

This commit is contained in:
cpq committed 2021-07-13 06:58:34 +01:00
1 parent f46453f80f
commit 015586950f
3 files changed
+14 -2

No files matched your search

+2 -2
View File
@@ -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