Skip to content

Commit

Permalink
Add 'extern "C"' on public headers.
Browse files Browse the repository at this point in the history
mosquitto_broker.h and mosquitto_plugin.h

Thanks to Wolfgang Petroschka.

Closes #1290.
  • Loading branch information
ralight committed May 23, 2019
1 parent a900e3a commit 00eee59
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions src/mosquitto_broker.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ and the Eclipse Distribution License is available at
#ifndef MOSQUITTO_BROKER_H
#define MOSQUITTO_BROKER_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdbool.h>

struct mosquitto;
Expand Down Expand Up @@ -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
10 changes: 10 additions & 0 deletions src/mosquitto_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ and the Eclipse Distribution License is available at
#ifndef MOSQUITTO_PLUGIN_H
#define MOSQUITTO_PLUGIN_H

#ifdef __cplusplus
extern "C" {
#endif

#define MOSQ_AUTH_PLUGIN_VERSION 4

#define MOSQ_ACL_NONE 0x00
Expand Down Expand Up @@ -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

0 comments on commit 00eee59

Please sign in to comment.