Add 'extern "C"' on public headers.

mosquitto_broker.h and mosquitto_plugin.h

Thanks to Wolfgang Petroschka.

Closes #1290.
pull/1600/head
Roger A. Light 6 years ago
parent 7c3c422803
commit fce996ae63

@ -16,6 +16,8 @@ Broker:
Closes #1273.
- Improve documentation around the upgrading of persistence files. Closes
#1276.
- Add 'extern "C"' on mosquitto_broker.h and mosquitto_plugin.h for C++ plugin
writing. Closes #1290.
Client library:
- Fix typo causing build error on Windows when building without TLS support.

@ -17,6 +17,10 @@ Contributors:
#ifndef MOSQUITTO_BROKER_H
#define MOSQUITTO_BROKER_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
struct mosquitto;
@ -161,4 +165,8 @@ const char *mosquitto_client_username(const struct mosquitto *client);
*/
int mosquitto_set_username(struct mosquitto *client, const char *username);
#ifdef __cplusplus
}
#endif
#endif

@ -17,6 +17,10 @@ Contributors:
#ifndef MOSQUITTO_PLUGIN_H
#define MOSQUITTO_PLUGIN_H
#ifdef __cplusplus
extern "C" {
#endif
#define MOSQ_AUTH_PLUGIN_VERSION 4
#define MOSQ_ACL_NONE 0x00
@ -305,4 +309,10 @@ int mosquitto_auth_psk_key_get(void *user_data, struct mosquitto *client, const
int mosquitto_auth_start(void *user_data, struct mosquitto *client, const char *method, bool reauth, const void *data_in, uint16_t data_in_len, void **data_out, uint16_t *data_out_len);
int mosquitto_auth_continue(void *user_data, struct mosquitto *client, const char *method, const void *data_in, uint16_t data_in_len, void **data_out, uint16_t *data_out_len);
#ifdef __cplusplus
}
#endif
#endif

Loading…
Cancel
Save