Skip to content

Commit

Permalink
Merge pull request #103 from vpetrigo/issue/89-configurable_PAL
Browse files Browse the repository at this point in the history
mqttc: Add an option to specify own MQTT-C PAL header file
  • Loading branch information
LiamBindle authored Aug 17, 2020
2 parents 63b8694 + 886801d commit 06a45d7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/mqtt.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,19 @@ SOFTWARE.
extern "C" {
#endif

// Users can override mqtt_pal.h with their own configuration by defining
// MQTTC_PAL_FILE as a header file to include (-DMQTTC_PAL_FILE=my_mqtt_pal.h).
//
// If MQTTC_PAL_FILE is used, none of the default utils will be emitted and must be
// provided by the config file. To start, I would suggest copying mqtt_pal.h
// and modifying as needed.
#ifdef MQTTC_PAL_FILE
#define MQTTC_STR2(x) #x
#define MQTTC_STR(x) MQTTC_STR2(x)
#include MQTTC_STR(MQTTC_PAL_FILE)
#else
#include <mqtt_pal.h>
#endif /* MQTT_PAL_FILE */

/**
* @file
Expand Down

0 comments on commit 06a45d7

Please sign in to comment.