- fix undefined disable_defer (!1685)
- daemon: fix a memory leak present since v6.0.9 (#927)
+Improvements
+------------
+- C++ compatibility of lib/ headers (!1689)
+
Knot Resolver 6.0.12 (2025-04-24)
=================================
/* We require C11 but want to avoid including the standard assertion header
* so we alias it ourselves. */
+#ifndef __cplusplus
#define static_assert _Static_assert
+#endif
/*
* Connection limits.
enum lru_apply_do (*(name))(const char *key, uint len, val_type *val, void *baton)
typedef lru_apply_fun_g(lru_apply_fun, void);
-#define CACHE_ALIGNED _Alignas(64)
+#define CACHE_ALIGNED alignas(64)
struct lru;
void lru_free_items_impl(struct lru *lru);
a[i] = 0;
}
-int kr_rrkey(char *key, uint16_t class, const knot_dname_t *owner,
+int kr_rrkey(char *key, uint16_t rrclass, const knot_dname_t *owner,
uint16_t type, uint16_t additional)
{
if (!key || !owner) {
return kr_error(EINVAL);
}
uint8_t *key_buf = (uint8_t *)key;
- int ret = u16tostr(key_buf, class);
+ int ret = u16tostr(key_buf, rrclass);
if (ret <= 0) {
return ret;
}
* \note Only internet addresses are supported, i.e. no AF_UNIX sockets.
*/
KR_EXPORT
-int kr_straddr_split(const char *instr, char ipaddr[static restrict (INET6_ADDRSTRLEN + 1)],
+int kr_straddr_split(const char *instr, char ipaddr[
+ #ifndef __cplusplus
+ static restrict (INET6_ADDRSTRLEN + 1)
+ #endif
+ ],
uint16_t *port);
/** Formats ip address and port in "addr#port" format.
* @return key length if successful or an error
* */
KR_EXPORT
-int kr_rrkey(char *key, uint16_t class, const knot_dname_t *owner,
+int kr_rrkey(char *key, uint16_t rrclass, const knot_dname_t *owner,
uint16_t type, uint16_t additional);
/** Add RRSet copy to a ranked RR array.
int kr_zonecut_find_cached(struct kr_context *ctx, struct kr_zonecut *cut,
const knot_dname_t *name, const struct kr_query *qry,
- bool * restrict secured)
+ bool *secured)
{
if (!ctx || !cut || !name)
return kr_error(EINVAL);
KR_EXPORT
int kr_zonecut_find_cached(struct kr_context *ctx, struct kr_zonecut *cut,
const knot_dname_t *name, const struct kr_query *qry,
- bool * restrict secured);
+ bool *secured);
/**
* Check if any address is present in the zone cut.
*