Skip to content

Cannot compile when WITH_MQTT=no #401

@atjn

Description

@atjn

It is currently impossible to compile the recorder without MQTT support because the new tours code calls the MQTT publish function.

This patch resolves all compilation errors, but I am not sure if it is a good solution:

--- a/recorder.c
+++ b/recorder.c
@@ -495,7 +495,9 @@ void do_request(struct udata *ud, UT_string *username, UT_string *device, char *
 		}
 
 		if ((js = json_stringify(resp, "  ")) != NULL) {
+#ifdef WITH_MQTT
 			publish(ud, UB(fulltopic), js);
+#endif
 			free(js);
 		}
 		json_delete(resp);
@@ -559,7 +561,9 @@ void do_request(struct udata *ud, UT_string *username, UT_string *device, char *
 		}
 
 		if ((js = json_stringify(resp, "  ")) != NULL) {
+#ifdef WITH_MQTT
 			publish(ud, UB(fulltopic), js);
+#endif
 			free(js);
 		}
 
-- 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions