From: Lennart Poettering Date: Wed, 30 Oct 2024 20:55:13 +0000 (+0100) Subject: sd-json: don't use C99 bool in public headers X-Git-Tag: v257-rc1~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ff3adeb2992ba59080d153db29ab48aa5bf7e58;p=thirdparty%2Fsystemd.git sd-json: don't use C99 bool in public headers All our public headers strive to C90 compatibility with a few extensions, and thus avoided stdbool.h and bool. The sd_json_format_enabled() helper seems like a poor place to start requiring stdbool.h now. Also drop __extension__ since we are not using it anywhere else in very similar inline functions. (And we probably should drop any _sd_const declarations on inline functions. Given that the compiler has the function implementation around always, because it's in the header there's really no reason to specify this manually, the compiler can trivially figure this out on its own. But that's for another time.) --- diff --git a/src/systemd/sd-json.h b/src/systemd/sd-json.h index 02c5843f079..3930d82b0d0 100644 --- a/src/systemd/sd-json.h +++ b/src/systemd/sd-json.h @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -343,7 +342,7 @@ int sd_json_variant_unhex(sd_json_variant *v, void **ret, size_t *ret_size); const char* sd_json_variant_type_to_string(sd_json_variant_type_t t); sd_json_variant_type_t sd_json_variant_type_from_string(const char *s); -__extension__ _sd_const_ static __inline__ bool sd_json_format_enabled(sd_json_format_flags_t flags) { +_sd_const_ static __inline__ int sd_json_format_enabled(sd_json_format_flags_t flags) { return !(flags & SD_JSON_FORMAT_OFF); } diff --git a/src/systemd/sd-varlink-idl.h b/src/systemd/sd-varlink-idl.h index e5e8a574988..620cbf50cb5 100644 --- a/src/systemd/sd-varlink-idl.h +++ b/src/systemd/sd-varlink-idl.h @@ -18,7 +18,6 @@ ***/ #include -#include #include #include "sd-json.h"