diff mbox series

Added extern "C" declarations to header-files.

Message ID 20190703112538.2506-1-jeremy@azazel.net
State Accepted
Delegated to: Pablo Neira
Headers show
Series Added extern "C" declarations to header-files. | expand

Commit Message

Jeremy Sowden July 3, 2019, 11:25 a.m. UTC
Declare functions with extern "C" for inclusion in C++.

Reported-by: Stefan Laufmann <stefan.laufmann@emlix.com>
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 include/libnetfilter_log/libipulog.h        | 8 ++++++++
 include/libnetfilter_log/libnetfilter_log.h | 8 ++++++++
 2 files changed, 16 insertions(+)

Comments

Pablo Neira Ayuso July 3, 2019, 11:35 a.m. UTC | #1
On Wed, Jul 03, 2019 at 12:25:38PM +0100, Jeremy Sowden wrote:
> Declare functions with extern "C" for inclusion in C++.

Applied, thanks.

Please, next time specify [PATCH libnetfilter_log] so we know what
tree this patch is going to :-)

Thanks.
Jeremy Sowden July 3, 2019, 11:37 a.m. UTC | #2
On 2019-07-03, at 13:35:35 +0200, Pablo Neira Ayuso wrote:
> On Wed, Jul 03, 2019 at 12:25:38PM +0100, Jeremy Sowden wrote:
> > Declare functions with extern "C" for inclusion in C++.
>
> Applied, thanks.
>
> Please, next time specify [PATCH libnetfilter_log] so we know what
> tree this patch is going to :-)

Cheers.  Will do. :)

J.
diff mbox series

Patch

diff --git a/include/libnetfilter_log/libipulog.h b/include/libnetfilter_log/libipulog.h
index ee7890a2d93c..deb0dcc72577 100644
--- a/include/libnetfilter_log/libipulog.h
+++ b/include/libnetfilter_log/libipulog.h
@@ -16,6 +16,10 @@ 
 #define ULOG_PREFIX_LEN	32
 #define ULOG_IFNAMSIZ	16
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Format of the ULOG packets passed through netlink */
 typedef struct ulog_packet_msg {
 	unsigned long mark;
@@ -67,5 +71,9 @@  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 46767eb003c9..6192fa3a5cf1 100644
--- a/include/libnetfilter_log/libnetfilter_log.h
+++ b/include/libnetfilter_log/libnetfilter_log.h
@@ -14,6 +14,10 @@ 
 #include <linux/netlink.h>
 #include <libnetfilter_log/linux_nfnetlink_log.h>
 
+#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 */