diff --git a/include/mosquitto_plugin.h b/include/mosquitto_plugin.h index d8a6c72c..447f4b89 100644 --- a/include/mosquitto_plugin.h +++ b/include/mosquitto_plugin.h @@ -140,9 +140,26 @@ struct mosquitto_acl_msg { * * If the broker does not support the version that you require, return -1 to * indicate failure. + * + * HELPER: If you only wish to declare support for a single version, you can + * use the helper macro: + * + * MOSQUITTO_PLUGIN_DECLARE_VERSION(5); */ mosq_plugin_EXPORT int mosquitto_plugin_version(int supported_version_count, const int *supported_versions); +#define MOSQUITTO_PLUGIN_DECLARE_VERSION(A) \ + int mosquitto_plugin_version(int supported_version_count, const int *supported_versions) \ + { \ + int i; \ + for(i=0; iproperties, MQTT_PROP_USER_PROPERTY, "timestamp", time_buf); } -int mosquitto_plugin_version(int supported_version_count, const int *supported_versions) -{ - int i; - - for(i=0; i