Browse Source

Rework cherry-picked commit to make build on i386 pass

Christoph Biedl 1 year ago
parent
commit
586fa91278

+ 3 - 2
debian/patches/cherry-pick.v2.9.4-9-g4f15b7d.fix-sizeof-http-parser-assert.patch

@@ -2,6 +2,8 @@ Subject: Fix sizeof(http_parser) assert
 Origin: v2.9.4-9-g4f15b7d <https://github.com/joyent/http-parser/commit/v2.9.4-9-g4f15b7d>
 Upstream-Author: Ben Noordhuis <info@bnoordhuis.nl>
 Date: Fri Jul 10 11:55:11 2020 +0200
+Bug: https://github.com/nodejs/http-parser/issues/526
+Comment: Changed again to make build pass on i386, see bug URL in previous line
 
     The result should be 32 on both 32 bits and 64 bits x86 because of
     struct padding.
@@ -16,13 +18,12 @@ Date: Fri Jul 10 11:55:11 2020 +0200
    printf("http_parser v%u.%u.%u (0x%06lx)\n", major, minor, patch, version);
  
    printf("sizeof(http_parser) = %u\n", (unsigned int)sizeof(http_parser));
--  assert(sizeof(http_parser) == 4 + 4 + 8 + 2 + 2 + 4 + sizeof(void *));
 +
 +#if defined(__i386__) || defined(__x86_64__)
 +  /* Should be 32 on both 32 bits and 64 bits x86 because of struct padding,
 +   * see https://github.com/nodejs/http-parser/issues/507.
 +   */
-+  assert(sizeof(http_parser) == 32);
+   assert(sizeof(http_parser) == 4 + 4 + 8 + 2 + 2 + 4 + sizeof(void *));
 +#endif
  
    //// API