From ddeac617c9914284038241870cb99ae174fb3755 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 26 Feb 2019 21:39:52 -0800 Subject: fixes #896 undefined reference to `nng_inproc_register()' We forgot to have __cplusplus guards on the protocol header files. --- include/nng/transport/inproc/inproc.h | 12 +++++++++++- include/nng/transport/ipc/ipc.h | 10 ++++++++++ include/nng/transport/tcp/tcp.h | 14 +++++++++++--- include/nng/transport/tls/tls.h | 12 +++++++++++- include/nng/transport/ws/websocket.h | 12 +++++++++++- include/nng/transport/zerotier/zerotier.h | 12 +++++++++++- 6 files changed, 65 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/nng/transport/inproc/inproc.h b/include/nng/transport/inproc/inproc.h index bfd6e1ca..80a83883 100644 --- a/include/nng/transport/inproc/inproc.h +++ b/include/nng/transport/inproc/inproc.h @@ -1,5 +1,5 @@ // -// Copyright 2017 Garrett D'Amore +// Copyright 2019 Staysail Systems, Inc. // Copyright 2017 Capitar IT Group BV // // This software is supplied under the terms of the MIT License, a @@ -11,8 +11,18 @@ #ifndef NNG_TRANSPORT_INPROC_INPROC_H #define NNG_TRANSPORT_INPROC_INPROC_H +#include + +#ifdef __cplusplus +extern "C" { +#endif + // inproc transport. This is used for intra-process communication. NNG_DECL int nng_inproc_register(void); +#ifdef __cplusplus +} +#endif + #endif // NNG_TRANSPORT_INPROC_INPROC_H diff --git a/include/nng/transport/ipc/ipc.h b/include/nng/transport/ipc/ipc.h index c69c4dc9..18d2046d 100644 --- a/include/nng/transport/ipc/ipc.h +++ b/include/nng/transport/ipc/ipc.h @@ -11,9 +11,19 @@ #ifndef NNG_TRANSPORT_IPC_IPC_H #define NNG_TRANSPORT_IPC_IPC_H +#include + +#ifdef __cplusplus +extern "C" { +#endif + // ipc transport. This is used for inter-process communication on // the same host computer. NNG_DECL int nng_ipc_register(void); +#ifdef __cplusplus +} +#endif + #endif // NNG_TRANSPORT_IPC_IPC_H diff --git a/include/nng/transport/tcp/tcp.h b/include/nng/transport/tcp/tcp.h index c2277e4b..2ca40b70 100644 --- a/include/nng/transport/tcp/tcp.h +++ b/include/nng/transport/tcp/tcp.h @@ -1,5 +1,5 @@ // -// Copyright 2017 Garrett D'Amore +// Copyright 2019 Staysail Systems, Inc. // Copyright 2017 Capitar IT Group BV // // This software is supplied under the terms of the MIT License, a @@ -11,10 +11,18 @@ #ifndef NNG_TRANSPORT_TCP_TCP_H #define NNG_TRANSPORT_TCP_TCP_H -// TCP transport. This is used for communication over TCP/IP. - #include +#ifdef __cplusplus +extern "C" { +#endif + +// TCP transport. This is used for communication over TCP/IP. + NNG_DECL int nng_tcp_register(void); +#ifdef __cplusplus +} +#endif + #endif // NNG_TRANSPORT_TCP_TCP_H diff --git a/include/nng/transport/tls/tls.h b/include/nng/transport/tls/tls.h index a3fa0eb9..700d5fff 100644 --- a/include/nng/transport/tls/tls.h +++ b/include/nng/transport/tls/tls.h @@ -1,5 +1,5 @@ // -// Copyright 2018 Staysail Systems, Inc. +// Copyright 2019 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // // This software is supplied under the terms of the MIT License, a @@ -11,8 +11,18 @@ #ifndef NNG_TRANSPORT_TLS_TLS_H #define NNG_TRANSPORT_TLS_TLS_H +#include + +#ifdef __cplusplus +extern "C" { +#endif + // TLS transport. This is used for communication via TLS v1.2 over TCP/IP. NNG_DECL int nng_tls_register(void); +#ifdef __cplusplus +} +#endif + #endif // NNG_TRANSPORT_TLS_TLS_H diff --git a/include/nng/transport/ws/websocket.h b/include/nng/transport/ws/websocket.h index 3d0d4fee..69577107 100644 --- a/include/nng/transport/ws/websocket.h +++ b/include/nng/transport/ws/websocket.h @@ -1,5 +1,5 @@ // -// Copyright 2018 Staysail Systems, Inc. +// Copyright 2019 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // // This software is supplied under the terms of the MIT License, a @@ -11,6 +11,12 @@ #ifndef NNG_TRANSPORT_WS_WEBSOCKET_H #define NNG_TRANSPORT_WS_WEBSOCKET_H +#include + +#ifdef __cplusplus +extern "C" { +#endif + // WebSocket transport. This is used for communication via WebSocket. NNG_DECL int nng_ws_register(void); @@ -21,4 +27,8 @@ NNG_DECL int nng_ws_register(void); NNG_DECL int nng_wss_register(void); +#ifdef __cplusplus +} +#endif + #endif // NNG_TRANSPORT_WS_WEBSOCKET_H diff --git a/include/nng/transport/zerotier/zerotier.h b/include/nng/transport/zerotier/zerotier.h index ab4d8511..ea73fea7 100644 --- a/include/nng/transport/zerotier/zerotier.h +++ b/include/nng/transport/zerotier/zerotier.h @@ -1,5 +1,5 @@ // -// Copyright 2018 Staysail Systems, Inc. +// Copyright 2019 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // // This software is supplied under the terms of the MIT License, a @@ -11,6 +11,8 @@ #ifndef NNG_TRANSPORT_ZEROTIER_ZEROTIER_H #define NNG_TRANSPORT_ZEROTIER_ZEROTIER_H +#include + // ZeroTier Transport. This sits on the ZeroTier L2 network, which itself // is implemented on top of UDP. This requires the 3rd party // libzerotiercore library (which is GPLv3!) and platform specific UDP @@ -129,6 +131,10 @@ // option takes no argument really. #define NNG_OPT_ZT_CLEAR_LOCAL_ADDRS "zt:clear-local-addrs" +#ifdef __cplusplus +extern "C" { +#endif + // Network status values. // These values are supplied to help folks checking status. They are the // return values from zt_opt_status. We avoid hard coding them as defines, @@ -146,4 +152,8 @@ enum nng_zt_status { NNG_DECL int nng_zt_register(void); +#ifdef __cplusplus +} +#endif + #endif // NNG_TRANSPORT_ZEROTIER_ZEROTIER_H -- cgit v1.2.3-70-g09d2