#include "mlx4.h"
+/*
+ * Compilation workaround for PPC64 when AltiVec is fully enabled, e.g. std=c11.
+ * Otherwise there would be a type conflict between stdbool and altivec.
+ */
+#if defined(__PPC64__) && !defined(__APPLE_ALTIVEC__)
+#undef bool
+/* redefine as in stdbool.h */
+#define bool _Bool
+#endif
+
extern int mlx4_logtype;
#ifndef NDEBUG
/** Allocate a buffer on the stack and fill it with a printf format string. */
#define MKSTR(name, ...) \
- char name[snprintf(NULL, 0, __VA_ARGS__) + 1]; \
+ int mkstr_size_##name = snprintf(NULL, 0, "" __VA_ARGS__); \
+ char name[mkstr_size_##name + 1]; \
\
- snprintf(name, sizeof(name), __VA_ARGS__)
+ snprintf(name, sizeof(name), "" __VA_ARGS__)
/** Generate a string out of the provided arguments. */
#define MLX4_STR(...) # __VA_ARGS__