From 6172ad70924be37de833facb41365eff1cec497b Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Fri, 14 Jul 2023 19:29:18 +0200 Subject: Minor changes --- src/publisher/Makefile | 2 +- src/publisher/main.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/publisher') diff --git a/src/publisher/Makefile b/src/publisher/Makefile index 605e667..57eccb9 100644 --- a/src/publisher/Makefile +++ b/src/publisher/Makefile @@ -1,5 +1,5 @@ EXEC=publisher -CFLAGS=-lzmq +CFLAGS+=-lzmq all: main.c $(CC) $^ -o $(OUT)/$(EXEC) $(CFLAGS) diff --git a/src/publisher/main.c b/src/publisher/main.c index 0abfefb..817d79f 100644 --- a/src/publisher/main.c +++ b/src/publisher/main.c @@ -6,12 +6,19 @@ #include #include +#define STR(symbol) #symbol +#define STRINGIFY(symbol) STR(symbol) + +#ifndef PUBLISHER_PORT +#error PUBLISHER_PORT macro undefined +#endif + int main (void) { // Prepare our context and publisher void *context = zmq_ctx_new (); void *publisher = zmq_socket (context, ZMQ_PUB); - int rc = zmq_bind (publisher, "tcp://*:5556"); + int rc = zmq_bind (publisher, "tcp://*:"STRINGIFY(PUBLISHER_PORT)); assert (rc == 0); // Initialize random number generator -- cgit v1.2.3