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/shared/dns-domain.c | |
parent | meson: check for sys/auxv.h (diff) | |
download | systemd-349cc4a507c4d84fcadf61f42159ea6412717896.tar.xz 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/shared/dns-domain.c')
-rw-r--r-- | src/shared/dns-domain.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c index 139d286af8..9804907304 100644 --- a/src/shared/dns-domain.c +++ b/src/shared/dns-domain.c @@ -17,9 +17,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#if defined(HAVE_LIBIDN2) +#if HAVE_LIBIDN2 # include <idn2.h> -#elif defined(HAVE_LIBIDN) +#elif HAVE_LIBIDN # include <idna.h> # include <stringprep.h> #endif @@ -301,7 +301,7 @@ int dns_label_escape_new(const char *p, size_t l, char **ret) { return r; } -#ifdef HAVE_LIBIDN +#if HAVE_LIBIDN int dns_label_apply_idna(const char *encoded, size_t encoded_size, char *decoded, size_t decoded_max) { _cleanup_free_ uint32_t *input = NULL; size_t input_size, l; @@ -1272,7 +1272,7 @@ int dns_name_common_suffix(const char *a, const char *b, const char **ret) { int dns_name_apply_idna(const char *name, char **ret) { /* Return negative on error, 0 if not implemented, positive on success. */ -#if defined(HAVE_LIBIDN2) +#if HAVE_LIBIDN2 int r; _cleanup_free_ char *t = NULL; @@ -1312,7 +1312,7 @@ int dns_name_apply_idna(const char *name, char **ret) { if (IN_SET(r, IDN2_TOO_BIG_DOMAIN, IDN2_TOO_BIG_LABEL)) return -ENOSPC; return -EINVAL; -#elif defined(HAVE_LIBIDN) +#elif HAVE_LIBIDN _cleanup_free_ char *buf = NULL; size_t n = 0, allocated = 0; bool first = true; |