aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-04-23 15:25:54 +0200
committerThomas White <taw@physics.org>2021-04-23 16:29:39 +0200
commit095cbebaf68cea40a281462ed6c8c55d1833ed59 (patch)
tree37339171123096d515f114bd94606bb7a0d0ee77 /libcrystfel
parent2e228aa06f5d8635e7e8226679ac0eb9acf32136 (diff)
MsgPack: More build system fixes
The changes in b22f6f524 were incorrect. config.h should never be included from libcrystfel headers, because that will include the main CrystFEL program config.h instead.
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/image-msgpack.c37
-rw-r--r--libcrystfel/src/image-msgpack.h39
2 files changed, 37 insertions, 39 deletions
diff --git a/libcrystfel/src/image-msgpack.c b/libcrystfel/src/image-msgpack.c
index aabfd6fa..2467dba2 100644
--- a/libcrystfel/src/image-msgpack.c
+++ b/libcrystfel/src/image-msgpack.c
@@ -47,6 +47,8 @@
#include "datatemplate_priv.h"
+#if defined(HAVE_MSGPACK)
+
static msgpack_object *find_main_object(msgpack_unpacked *unpacked)
{
int n_obj;
@@ -405,3 +407,38 @@ int image_msgpack_read(struct image *image,
msgpack_unpacked_destroy(&unpacked);
return 0;
}
+
+
+#else /* defined(HAVE_MSGPACK) */
+
+static UNUSED int image_msgpack_read(struct image *image,
+ const DataTemplate *dtempl,
+ void *data,
+ size_t data_size)
+{
+ ERROR("MessagePack is not supported in this installation (read).\n");
+ return 1;
+}
+
+static UNUSED ImageFeatureList *image_msgpack_read_peaks(const DataTemplate *dtempl,
+ void *data,
+ size_t data_size,
+ int half_pixel_shift)
+{
+ ERROR("MessagePack is not supported in this installation (read_peaks).\n");
+ return NULL;
+}
+
+static UNUSED double image_msgpack_get_value(const char *name,
+ void *data_block,
+ size_t data_block_size,
+ char *ptype)
+{
+ ERROR("MessagePack is not supported in this installation (get_value).\n");
+ *ptype = 'f';
+ return NAN;
+}
+
+
+
+#endif /* defined(HAVE_MSGPACK) */
diff --git a/libcrystfel/src/image-msgpack.h b/libcrystfel/src/image-msgpack.h
index 0449c718..26cf6b4e 100644
--- a/libcrystfel/src/image-msgpack.h
+++ b/libcrystfel/src/image-msgpack.h
@@ -29,13 +29,8 @@
#ifndef IMAGE_MSGPACK_H
#define IMAGE_MSGPACK_H
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include "datatemplate.h"
-#if defined(HAVE_MSGPACK)
extern int image_msgpack_read(struct image *image,
const DataTemplate *dtempl,
@@ -52,38 +47,4 @@ extern double image_msgpack_get_value(const char *name,
size_t data_block_size,
char *ptype);
-#else /* defined(HAVE_MSGPACK) */
-
-static UNUSED int image_msgpack_read(struct image *image,
- const DataTemplate *dtempl,
- void *data,
- size_t data_size)
-{
- ERROR("MessagePack is not supported in this installation.\n");
- return 1;
-}
-
-static UNUSED ImageFeatureList *image_msgpack_read_peaks(const DataTemplate *dtempl,
- void *data,
- size_t data_size,
- int half_pixel_shift)
-{
- ERROR("MessagePack is not supported in this installation.\n");
- return NULL;
-}
-
-static UNUSED double image_msgpack_get_value(const char *name,
- void *data_block,
- size_t data_block_size,
- char *ptype)
-{
- ERROR("MessagePack is not supported in this installation.\n");
- *ptype = 'f';
- return NAN;
-}
-
-
-
-#endif /* defined(HAVE_MSGPACK) */
-
#endif /* IMAGE_MSGPACK_H */