diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-10-03 10:41:51 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-10-04 12:09:29 +0200 |
commit | 349cc4a507c4d84fcadf61f42159ea6412717896 (patch) | |
tree | 8d6e64af681fb4e1e41a1fc01b4f225f56aa147d /src/udev | |
parent | meson: check for sys/auxv.h (diff) | |
download | systemd-349cc4a507c4d84fcadf61f42159ea6412717896.tar.gz systemd-349cc4a507c4d84fcadf61f42159ea6412717896.tar.bz2 systemd-349cc4a507c4d84fcadf61f42159ea6412717896.zip |
build-sys: use #if Y instead of #ifdef Y everywhere
The advantage is that is the name is mispellt, cpp will warn us.
$ git grep -Ee "conf.set\('(HAVE|ENABLE)_" -l|xargs sed -r -i "s/conf.set\('(HAVE|ENABLE)_/conf.set10('\1_/"
$ git grep -Ee '#ifn?def (HAVE|ENABLE)' -l|xargs sed -r -i 's/#ifdef (HAVE|ENABLE)/#if \1/; s/#ifndef (HAVE|ENABLE)/#if ! \1/;'
$ git grep -Ee 'if.*defined\(HAVE' -l|xargs sed -i -r 's/defined\((HAVE_[A-Z0-9_]*)\)/\1/g'
$ git grep -Ee 'if.*defined\(ENABLE' -l|xargs sed -i -r 's/defined\((ENABLE_[A-Z0-9_]*)\)/\1/g'
+ manual changes to meson.build
squash! build-sys: use #if Y instead of #ifdef Y everywhere
v2:
- fix incorrect setting of HAVE_LIBIDN2
Diffstat (limited to 'src/udev')
-rw-r--r-- | src/udev/meson.build | 6 | ||||
-rw-r--r-- | src/udev/net/link-config.c | 2 | ||||
-rw-r--r-- | src/udev/udev-builtin-blkid.c | 2 | ||||
-rw-r--r-- | src/udev/udev-builtin-btrfs.c | 2 | ||||
-rw-r--r-- | src/udev/udev-builtin.c | 6 | ||||
-rw-r--r-- | src/udev/udev.h | 10 |
6 files changed, 14 insertions, 14 deletions
diff --git a/src/udev/meson.build b/src/udev/meson.build index eeb341f8d..dd24b7e9f 100644 --- a/src/udev/meson.build +++ b/src/udev/meson.build @@ -36,15 +36,15 @@ libudev_core_sources = ''' net/ethtool-util.h '''.split() -if conf.get('HAVE_KMOD', false) +if conf.get('HAVE_KMOD') == 1 libudev_core_sources += ['udev-builtin-kmod.c'] endif -if conf.get('HAVE_BLKID', false) +if conf.get('HAVE_BLKID') == 1 libudev_core_sources += ['udev-builtin-blkid.c'] endif -if conf.get('HAVE_ACL', false) +if conf.get('HAVE_ACL') == 1 libudev_core_sources += ['udev-builtin-uaccess.c', logind_acl_c, sd_login_c] diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index 6ece1250f..a5f3b1a1b 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -58,7 +58,7 @@ static const char* const link_dirs[] = { "/etc/systemd/network", "/run/systemd/network", "/usr/lib/systemd/network", -#ifdef HAVE_SPLIT_USR +#if HAVE_SPLIT_USR "/lib/systemd/network", #endif NULL}; diff --git a/src/udev/udev-builtin-blkid.c b/src/udev/udev-builtin-blkid.c index 11d708515..4487e8269 100644 --- a/src/udev/udev-builtin-blkid.c +++ b/src/udev/udev-builtin-blkid.c @@ -107,7 +107,7 @@ static void print_property(struct udev_device *dev, bool test, const char *name, static int find_gpt_root(struct udev_device *dev, blkid_probe pr, bool test) { -#if defined(GPT_ROOT_NATIVE) && defined(ENABLE_EFI) +#if defined(GPT_ROOT_NATIVE) && ENABLE_EFI _cleanup_free_ char *root_id = NULL; bool found_esp = false; diff --git a/src/udev/udev-builtin-btrfs.c b/src/udev/udev-builtin-btrfs.c index cfaa46380..4d59cc82a 100644 --- a/src/udev/udev-builtin-btrfs.c +++ b/src/udev/udev-builtin-btrfs.c @@ -21,7 +21,7 @@ #include <stdlib.h> #include <sys/ioctl.h> -#ifdef HAVE_LINUX_BTRFS_H +#if HAVE_LINUX_BTRFS_H #include <linux/btrfs.h> #endif diff --git a/src/udev/udev-builtin.c b/src/udev/udev-builtin.c index e6b36f124..e4dccd0b0 100644 --- a/src/udev/udev-builtin.c +++ b/src/udev/udev-builtin.c @@ -27,21 +27,21 @@ static bool initialized; static const struct udev_builtin *builtins[] = { -#ifdef HAVE_BLKID +#if HAVE_BLKID [UDEV_BUILTIN_BLKID] = &udev_builtin_blkid, #endif [UDEV_BUILTIN_BTRFS] = &udev_builtin_btrfs, [UDEV_BUILTIN_HWDB] = &udev_builtin_hwdb, [UDEV_BUILTIN_INPUT_ID] = &udev_builtin_input_id, [UDEV_BUILTIN_KEYBOARD] = &udev_builtin_keyboard, -#ifdef HAVE_KMOD +#if HAVE_KMOD [UDEV_BUILTIN_KMOD] = &udev_builtin_kmod, #endif [UDEV_BUILTIN_NET_ID] = &udev_builtin_net_id, [UDEV_BUILTIN_NET_LINK] = &udev_builtin_net_setup_link, [UDEV_BUILTIN_PATH_ID] = &udev_builtin_path_id, [UDEV_BUILTIN_USB_ID] = &udev_builtin_usb_id, -#ifdef HAVE_ACL +#if HAVE_ACL [UDEV_BUILTIN_UACCESS] = &udev_builtin_uaccess, #endif }; diff --git a/src/udev/udev.h b/src/udev/udev.h index c0cb7eae8..2204db5a9 100644 --- a/src/udev/udev.h +++ b/src/udev/udev.h @@ -146,21 +146,21 @@ int udev_ctrl_get_set_children_max(struct udev_ctrl_msg *ctrl_msg); /* built-in commands */ enum udev_builtin_cmd { -#ifdef HAVE_BLKID +#if HAVE_BLKID UDEV_BUILTIN_BLKID, #endif UDEV_BUILTIN_BTRFS, UDEV_BUILTIN_HWDB, UDEV_BUILTIN_INPUT_ID, UDEV_BUILTIN_KEYBOARD, -#ifdef HAVE_KMOD +#if HAVE_KMOD UDEV_BUILTIN_KMOD, #endif UDEV_BUILTIN_NET_ID, UDEV_BUILTIN_NET_LINK, UDEV_BUILTIN_PATH_ID, UDEV_BUILTIN_USB_ID, -#ifdef HAVE_ACL +#if HAVE_ACL UDEV_BUILTIN_UACCESS, #endif UDEV_BUILTIN_MAX @@ -174,14 +174,14 @@ struct udev_builtin { bool (*validate)(struct udev *udev); bool run_once; }; -#ifdef HAVE_BLKID +#if HAVE_BLKID extern const struct udev_builtin udev_builtin_blkid; #endif extern const struct udev_builtin udev_builtin_btrfs; extern const struct udev_builtin udev_builtin_hwdb; extern const struct udev_builtin udev_builtin_input_id; extern const struct udev_builtin udev_builtin_keyboard; -#ifdef HAVE_KMOD +#if HAVE_KMOD extern const struct udev_builtin udev_builtin_kmod; #endif extern const struct udev_builtin udev_builtin_net_id; |