gnu: Add iputils.
[jackhill/guix/guix.git] / gnu / packages / patches / http-parser-fix-assertion-on-armhf.patch
CommitLineData
5c30eb61
TGR
1From: Tobias Geerinckx-Rice <me@tobias.gr>
2Date: Wed, 20 May 2020 19:17:13 +0200
3Subject: [PATCH] gnu: http-client: Fix assertion on armhf-linux.
4
5Copied verbatim from [0] to fix guix pull[1] on ARM systems.
6
7[0]: https://github.com/nodejs/http-parser/pull/510
8[1]: https://issues.guix.gnu.org/40604
9
10From 0e5868aebb9eb92b078d27bb2774c2154dc167e2 Mon Sep 17 00:00:00 2001
11From: Ben Noordhuis <info@bnoordhuis.nl>
12Date: Thu, 30 Apr 2020 11:22:50 +0200
13Subject: [PATCH] Fix sizeof(http_parser) assert
14
15The result should be 32 on both 32 bits and 64 bits architectures
16because of struct padding.
17
18Fixes: https://github.com/nodejs/http-parser/issues/507
19---
20 test.c | 5 ++++-
21 1 file changed, 4 insertions(+), 1 deletion(-)
22
23diff --git a/test.c b/test.c
24index 7983424..f60a84f 100644
25--- a/test.c
26+++ b/test.c
27@@ -4220,8 +4220,11 @@ main (void)
28 patch = version & 255;
29 printf("http_parser v%u.%u.%u (0x%06lx)\n", major, minor, patch, version);
30
31+ /* Should be 32 on both 32 bits and 64 bits architectures because of
32+ * struct padding, see https://github.com/nodejs/http-parser/issues/507.
33+ */
34 printf("sizeof(http_parser) = %u\n", (unsigned int)sizeof(http_parser));
35- assert(sizeof(http_parser) == 4 + 4 + 8 + 2 + 2 + 4 + sizeof(void *));
36+ assert(sizeof(http_parser) == 32);
37
38 //// API
39 test_preserve_data();