The mask is using the log2 function which pulls in the libm. The library
is not always available, e.g when building statically. This makes the
whole build logic way to complex for something like this.
Instead calculating during runtime the bitmask just use the static ilog
macros from ccan.
Signed-off-by: Daniel Wagner <dwagner@suse.de>
#include "nlog.h"
#include "config.h"
#include <string.h>
-#include <math.h>
#include <stdio.h>
+#include "ccan/ilog/ilog.h"
+
#define LOG_ENTRY_HEADER_SIZE 1
#define LOG_ENTRY_TIMESTAMP_SIZE 2
#define LOG_ENTRY_NUM_ARGS_MAX 8
#define LOG_ENTRY_MAX_SIZE (LOG_ENTRY_HEADER_SIZE + LOG_ENTRY_TIMESTAMP_SIZE + \
LOG_ENTRY_NUM_ARGS_MAX)
-#define NUM_ARGS_MASK ((1 << ((int)log2(LOG_ENTRY_NUM_ARGS_MAX)+1)) - 1)
+#define NUM_ARGS_MASK ((1 << ((int)STATIC_ILOG_32(LOG_ENTRY_NUM_ARGS_MAX))) - 1)
#define MAX_HEADER_MISMATCH_TRACK 10
static int formats_find(struct json_object *formats, uint32_t val, struct json_object **format)