* Import `"collectd.h"` for `<stdint.h>`.
* Make `decode` static, otherwise GCC complains about it reading from a
static variable.
libmetric.la \
libmount.la \
liboconfig.la \
- libstrbuf.la
+ libstrbuf.la \
+ libutf8.la
check_LTLIBRARIES = \
liboconfig_la_CPPFLAGS = -I$(srcdir)/src/liboconfig $(AM_CPPFLAGS)
liboconfig_la_LDFLAGS = -avoid-version $(LEXLIB)
+libutf8_la_SOURCES = src/utils/utf8/utf8.c
+
if BUILD_WITH_LIBCURL
if BUILD_WITH_LIBSSL
if BUILD_WITH_LIBYAJL2
// See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
+#include "collectd.h"
+
#define UTF8_ACCEPT 0
#define UTF8_REJECT 1
};
// clang-format on
-uint32_t inline decode(uint32_t *state, uint32_t *codep, uint32_t byte) {
+static uint32_t decode(uint32_t *state, uint32_t *codep, uint32_t byte) {
uint32_t type = utf8d[byte];
*codep = (*state != UTF8_ACCEPT) ? (byte & 0x3fu) | (*codep << 6)