diff options
author | otis <otis@pkgsrc.org> | 2020-11-11 18:57:15 +0000 |
---|---|---|
committer | otis <otis@pkgsrc.org> | 2020-11-11 18:57:15 +0000 |
commit | b7d5a4a194f4e26a4d72e25e1e8ce9a231711458 (patch) | |
tree | 2c7d8e8eca9f73087d5e5eea2b2e08de8860ec08 | |
parent | f136c501e93c74f2303a8c21adcac4e8709df8eb (diff) | |
download | pkgsrc-b7d5a4a194f4e26a4d72e25e1e8ce9a231711458.tar.gz |
mutt: Fix build on platforms without u_int32_t
-rw-r--r-- | mail/mutt/distinfo | 3 | ||||
-rw-r--r-- | mail/mutt/patches/patch-mutt__random.c | 29 |
2 files changed, 31 insertions, 1 deletions
diff --git a/mail/mutt/distinfo b/mail/mutt/distinfo index d20e1d5da67..3bfda3be8f0 100644 --- a/mail/mutt/distinfo +++ b/mail/mutt/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.86 2020/11/08 17:42:45 tron Exp $ +$NetBSD: distinfo,v 1.87 2020/11/11 18:57:15 otis Exp $ SHA1 (mutt-2.0.0.tar.gz) = 2554e214f2f0e6ff148a33805af6b00bb57ee988 RMD160 (mutt-2.0.0.tar.gz) = 778578909487e7182dd0418416e63a002832ca6b @@ -9,3 +9,4 @@ SHA1 (patch-color.c) = 69964830c13d4113e78a19539aad1e560825182a SHA1 (patch-configure) = cbd7ff52b0b358fff41988d286267046f56ee8d5 SHA1 (patch-doc_Makefile.in) = 8086887afeec554d0c78047a48ec3eb33d38f26c SHA1 (patch-lib.h) = f10c32fc891a3c70c7379e092159e207b6c27b8b +SHA1 (patch-mutt__random.c) = 73a9a4fd24b8cf4f6354930d2c7dd91d29d46231 diff --git a/mail/mutt/patches/patch-mutt__random.c b/mail/mutt/patches/patch-mutt__random.c new file mode 100644 index 00000000000..6dfce486664 --- /dev/null +++ b/mail/mutt/patches/patch-mutt__random.c @@ -0,0 +1,29 @@ +$NetBSD: patch-mutt__random.c,v 1.1 2020/11/11 18:57:15 otis Exp $ + +Cast to more portable C99 uint32_t + +--- mutt_random.c.orig 2020-11-03 17:50:37.000000000 +0000 ++++ mutt_random.c +@@ -29,7 +29,7 @@ + #include <sys/types.h> + #include <unistd.h> + +-static u_int32_t z[4]; /* Keep state for LFRS113 PRNG */ ++static uint32_t z[4]; /* Keep state for LFRS113 PRNG */ + static int rand_bytes_produced = 0; + static time_t time_last_reseed = 0; + +@@ -92,11 +92,11 @@ void mutt_reseed (void) + * Use as many of the lower order bits from the current time of day as the seed. + * If the upper bound is truncated, that is fine. + * +- * tv_sec is integral of type integer or float. Cast to 'u_int32_t' before ++ * tv_sec is integral of type integer or float. Cast to 'uint32_t' before + * bitshift in case it is a float. */ + + /* Finally, set our seeds */ +- z[0] ^= (((u_int32_t) tv.tv_sec << 20) | tv.tv_usec); ++ z[0] ^= (((uint32_t) tv.tv_sec << 20) | tv.tv_usec); + z[1] ^= getpid () ^ z[0]; + z[2] ^= getppid () ^ z[0]; + z[3] ^= (intptr_t) &z[3] ^ time_last_reseed ^ z[0]; |