mirror of
https://github.com/systemd/systemd.git
synced 2024-11-24 02:33:36 +08:00
build-sys: add check for gperf lookup function signature (#5055)
gperf-3.1 generates lookup functions that take a size_t length parameter instead of unsigned int. Test for this at configure time. Fixes: https://github.com/systemd/systemd/issues/5039
This commit is contained in:
parent
64083a6078
commit
c9f7b4d356
22
configure.ac
22
configure.ac
@ -255,6 +255,28 @@ AC_CHECK_SIZEOF(rlim_t,,[
|
||||
#include <sys/resource.h>
|
||||
])
|
||||
|
||||
GPERF_TEST="$(echo foo,bar | ${GPERF} -L ANSI-C)"
|
||||
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([
|
||||
#include <string.h>
|
||||
const char * in_word_set(const char *, size_t);
|
||||
$GPERF_TEST]
|
||||
)],
|
||||
[GPERF_LEN_TYPE=size_t],
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([
|
||||
#include <string.h>
|
||||
const char * in_word_set(const char *, unsigned);
|
||||
$GPERF_TEST]
|
||||
)],
|
||||
[GPERF_LEN_TYPE=unsigned],
|
||||
[AC_MSG_ERROR([** unable to determine gperf len type])]
|
||||
)]
|
||||
)
|
||||
|
||||
AC_DEFINE_UNQUOTED([GPERF_LEN_TYPE], [$GPERF_LEN_TYPE], [gperf len type])
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# we use python to build the man page index
|
||||
have_python=no
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "af-list.h"
|
||||
#include "macro.h"
|
||||
|
||||
static const struct af_name* lookup_af(register const char *str, register unsigned int len);
|
||||
static const struct af_name* lookup_af(register const char *str, register GPERF_LEN_TYPE len);
|
||||
|
||||
#include "af-from-name.h"
|
||||
#include "af-to-name.h"
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "arphrd-list.h"
|
||||
#include "macro.h"
|
||||
|
||||
static const struct arphrd_name* lookup_arphrd(register const char *str, register unsigned int len);
|
||||
static const struct arphrd_name* lookup_arphrd(register const char *str, register GPERF_LEN_TYPE len);
|
||||
|
||||
#include "arphrd-from-name.h"
|
||||
#include "arphrd-to-name.h"
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "parse-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static const struct capability_name* lookup_capability(register const char *str, register unsigned int len);
|
||||
static const struct capability_name* lookup_capability(register const char *str, register GPERF_LEN_TYPE len);
|
||||
|
||||
#include "cap-from-name.h"
|
||||
#include "cap-to-name.h"
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "macro.h"
|
||||
|
||||
static const struct errno_name* lookup_errno(register const char *str,
|
||||
register unsigned int len);
|
||||
register GPERF_LEN_TYPE len);
|
||||
|
||||
#include "errno-from-name.h"
|
||||
#include "errno-to-name.h"
|
||||
|
@ -120,7 +120,7 @@ int config_parse_restrict_namespaces(const char *unit, const char *filename, uns
|
||||
int config_parse_bind_paths(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
|
||||
|
||||
/* gperf prototypes */
|
||||
const struct ConfigPerfItem* load_fragment_gperf_lookup(const char *key, unsigned length);
|
||||
const struct ConfigPerfItem* load_fragment_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
|
||||
extern const char load_fragment_gperf_nulstr[];
|
||||
|
||||
typedef enum Disabled {
|
||||
|
@ -179,7 +179,7 @@ void server_dispatch_message(Server *s, struct iovec *iovec, unsigned n, unsigne
|
||||
void server_driver_message(Server *s, sd_id128_t message_id, const char *format, ...) _printf_(3,0) _sentinel_;
|
||||
|
||||
/* gperf lookup function */
|
||||
const struct ConfigPerfItem* journald_gperf_lookup(const char *key, unsigned length);
|
||||
const struct ConfigPerfItem* journald_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
|
||||
|
||||
int config_parse_storage(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
|
||||
|
||||
|
@ -182,7 +182,7 @@ int manager_unit_is_active(Manager *manager, const char *unit);
|
||||
int manager_job_is_active(Manager *manager, const char *path);
|
||||
|
||||
/* gperf lookup function */
|
||||
const struct ConfigPerfItem* logind_gperf_lookup(const char *key, unsigned length);
|
||||
const struct ConfigPerfItem* logind_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
|
||||
|
||||
int manager_set_lid_switch_ignore(Manager *m, usec_t until);
|
||||
|
||||
|
@ -175,7 +175,7 @@ NetDevKind netdev_kind_from_string(const char *d) _pure_;
|
||||
int config_parse_netdev_kind(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
|
||||
|
||||
/* gperf */
|
||||
const struct ConfigPerfItem* network_netdev_gperf_lookup(const char *key, unsigned length);
|
||||
const struct ConfigPerfItem* network_netdev_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
|
||||
|
||||
/* Macros which append INTERFACE= to the message */
|
||||
|
||||
|
@ -23,7 +23,7 @@ typedef struct Manager Manager;
|
||||
|
||||
int manager_parse_config_file(Manager *m);
|
||||
|
||||
const struct ConfigPerfItem* networkd_gperf_lookup(const char *key, unsigned length);
|
||||
const struct ConfigPerfItem* networkd_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
|
||||
|
||||
int config_parse_duid_type(
|
||||
const char *unit,
|
||||
|
@ -244,7 +244,7 @@ int config_parse_ntp(const char *unit, const char *filename, unsigned line, cons
|
||||
/* Legacy IPv4LL support */
|
||||
int config_parse_ipv4ll(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
|
||||
|
||||
const struct ConfigPerfItem* network_network_gperf_lookup(const char *key, unsigned length);
|
||||
const struct ConfigPerfItem* network_network_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
|
||||
|
||||
extern const sd_bus_vtable network_vtable[];
|
||||
|
||||
|
@ -103,7 +103,7 @@ bool settings_private_network(Settings *s);
|
||||
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(Settings*, settings_free);
|
||||
|
||||
const struct ConfigPerfItem* nspawn_gperf_lookup(const char *key, unsigned length);
|
||||
const struct ConfigPerfItem* nspawn_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
|
||||
|
||||
int config_parse_capability(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
|
||||
int config_parse_id128(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
|
||||
|
@ -29,7 +29,7 @@ typedef const struct {
|
||||
} dns_type;
|
||||
|
||||
static const struct dns_type_name *
|
||||
lookup_dns_type (register const char *str, register unsigned int len);
|
||||
lookup_dns_type (register const char *str, register GPERF_LEN_TYPE len);
|
||||
|
||||
#include "dns_type-from-name.h"
|
||||
#include "dns_type-to-name.h"
|
||||
|
@ -41,7 +41,7 @@ int manager_parse_search_domains_and_warn(Manager *m, const char *string);
|
||||
int manager_add_dns_server_by_string(Manager *m, DnsServerType type, const char *word);
|
||||
int manager_parse_dns_server_string_and_warn(Manager *m, DnsServerType type, const char *string);
|
||||
|
||||
const struct ConfigPerfItem* resolved_gperf_lookup(const char *key, unsigned length);
|
||||
const struct ConfigPerfItem* resolved_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
|
||||
|
||||
int config_parse_dns_servers(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
|
||||
int config_parse_search_domains(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "string-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static const struct af_name* lookup_af(register const char *str, register unsigned int len);
|
||||
static const struct af_name* lookup_af(register const char *str, register GPERF_LEN_TYPE len);
|
||||
|
||||
#include "af-from-name.h"
|
||||
#include "af-list.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "string-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static const struct arphrd_name* lookup_arphrd(register const char *str, register unsigned int len);
|
||||
static const struct arphrd_name* lookup_arphrd(register const char *str, register GPERF_LEN_TYPE len);
|
||||
|
||||
#include "arphrd-from-name.h"
|
||||
#include "arphrd-list.h"
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "conf-parser.h"
|
||||
#include "timesyncd-manager.h"
|
||||
|
||||
const struct ConfigPerfItem* timesyncd_gperf_lookup(const char *key, unsigned length);
|
||||
const struct ConfigPerfItem* timesyncd_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
|
||||
|
||||
int manager_parse_server_string(Manager *m, ServerType type, const char *string);
|
||||
|
||||
|
@ -94,7 +94,7 @@ const char *mac_policy_to_string(MACPolicy p) _const_;
|
||||
MACPolicy mac_policy_from_string(const char *p) _pure_;
|
||||
|
||||
/* gperf lookup function */
|
||||
const struct ConfigPerfItem* link_config_gperf_lookup(const char *key, unsigned length);
|
||||
const struct ConfigPerfItem* link_config_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
|
||||
|
||||
int config_parse_mac_policy(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
|
||||
int config_parse_name_policy(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "string-util.h"
|
||||
#include "udev.h"
|
||||
|
||||
static const struct key *keyboard_lookup_key(const char *str, unsigned len);
|
||||
static const struct key *keyboard_lookup_key(const char *str, GPERF_LEN_TYPE len);
|
||||
#include "keyboard-keys-from-name.h"
|
||||
|
||||
static int install_force_release(struct udev_device *dev, const unsigned *release, unsigned release_count) {
|
||||
|
Loading…
Reference in New Issue
Block a user