From ccfec26dd1a7c404257e13770aeab1007a2212c9 Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Wed, 3 Jul 2019 12:25:38 +0100 Subject: include: Add extern "C" declarations to header-files. Declare functions with extern "C" for inclusion in C++. Reported-by: Stefan Laufmann Signed-off-by: Jeremy Sowden Signed-off-by: Pablo Neira Ayuso --- include/libnetfilter_log/libipulog.h | 7 +++++++ include/libnetfilter_log/libnetfilter_log.h | 8 ++++++++ 2 files changed, 15 insertions(+) (limited to 'include') diff --git a/include/libnetfilter_log/libipulog.h b/include/libnetfilter_log/libipulog.h index ee7890a..4d87913 100644 --- a/include/libnetfilter_log/libipulog.h +++ b/include/libnetfilter_log/libipulog.h @@ -7,6 +7,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /* FIXME: glibc sucks */ #ifndef MSG_TRUNC #define MSG_TRUNC 0x20 @@ -67,5 +71,8 @@ enum }; #define IPULOG_MAXERR IPULOG_ERR_INVNL +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* _LIBIPULOG_H */ diff --git a/include/libnetfilter_log/libnetfilter_log.h b/include/libnetfilter_log/libnetfilter_log.h index 46767eb..6192fa3 100644 --- a/include/libnetfilter_log/libnetfilter_log.h +++ b/include/libnetfilter_log/libnetfilter_log.h @@ -14,6 +14,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + struct nflog_handle; struct nflog_g_handle; struct nflog_data; @@ -97,4 +101,8 @@ int nflog_nlmsg_snprintf(char *buf, size_t bufsiz, const struct nlmsghdr *nlh, struct nlattr **attr, enum nflog_output_type type, uint32_t flags); +#ifdef __cplusplus +} /* extern "C" */ +#endif + #endif /* __LIBNETFILTER_LOG_H */ -- cgit v1.2.3