diff options
author | Thomas White <taw@physics.org> | 2019-01-15 11:02:29 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2019-03-14 11:36:56 +0100 |
commit | bb4c1e37b6787f6ea77820d21a81e8380309343a (patch) | |
tree | 4582ee9f2b07bd909d65f49963ed3fdb62c5bf47 /src/im-zmq.h | |
parent | 6e657c8cc37dfb310e95e040ced6d13726cc491f (diff) |
Compile cleanly without Msgpack or ZMQ
Diffstat (limited to 'src/im-zmq.h')
-rw-r--r-- | src/im-zmq.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/im-zmq.h b/src/im-zmq.h index eb2c6068..86181347 100644 --- a/src/im-zmq.h +++ b/src/im-zmq.h @@ -36,22 +36,40 @@ #include <config.h> #endif -#include <msgpack.h> - #include "image.h" -extern struct im_zmq *im_zmq_connect(const char *zmq_address); +#if defined(HAVE_MSGPACK) && defined(HAVE_ZMQ) -extern msgpack_object *im_zmq_fetch(struct im_zmq *z); +#include <msgpack.h> + +extern struct im_zmq *im_zmq_connect(const char *zmq_address); extern void im_zmq_clean(struct im_zmq *z); extern void im_zmq_shutdown(struct im_zmq *z); +extern msgpack_object *im_zmq_fetch(struct im_zmq *z); + extern int get_peaks_msgpack(msgpack_object *obj, struct image *image, int half_pixel_shift); extern int unpack_msgpack_data(msgpack_object *obj, struct image *image); +#else /* defined(HAVE_MSGPACK) && defined(HAVE_ZMQ) */ + +static UNUSED struct im_zmq *im_zmq_connect(const char *zmq_address) { return NULL; } + +static UNUSED void im_zmq_clean(struct im_zmq *z) { return; } + +static UNUSED void im_zmq_shutdown(struct im_zmq *z) { return; } + +static UNUSED void *im_zmq_fetch(struct im_zmq *z) { return NULL; } + +static UNUSED int get_peaks_msgpack(void *obj, struct image *image, + int half_pixel_shift) { return 0; } + +static UNUSED int unpack_msgpack_data(void *obj, struct image *image) { return 1; } + +#endif /* defined(HAVE_MSGPACK) && defined(HAVE_ZMQ) */ #endif /* CRYSTFEL_ZMQ_H */ |