From: Alexander Tsoy Date: Sat, 8 Sep 2018 23:47:09 +0000 (+0300) Subject: install: avoid non-portable __WORDSIZE X-Git-Tag: 049~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=838f22259a50e5f92429ecdd24b897c1128edc98;p=thirdparty%2Fdracut.git install: avoid non-portable __WORDSIZE Lets not unnecessarily rely on __WORDSIZE, which is not clearly specified by any spec. Use explicit size comparisons if we're not interested in the WORDSIZE, anyway. Patch ported from systemd. (commit 8507eb20b64010b26f23822cbf442bb0bf96511c) Original-patch-by: Emil Renner Berthing Bug: https://bugs.gentoo.org/602122 --- diff --git a/install/util.h b/install/util.h index 2ad3254d9..c13b1a270 100644 --- a/install/util.h +++ b/install/util.h @@ -167,7 +167,7 @@ int safe_atoi(const char *s, int *ret_i); int safe_atollu(const char *s, unsigned long long *ret_u); int safe_atolli(const char *s, long long int *ret_i); -#if __WORDSIZE == 32 +#if LONG_MAX == INT_MAX static inline int safe_atolu(const char *s, unsigned long *ret_u) { assert_cc(sizeof(unsigned long) == sizeof(unsigned)); return safe_atou(s, (unsigned*) ret_u);