void-packages/srcpkgs/lwipv6/patches/endian.patch
Đoàn Trần Công Danh 861ac185a6 srcpkgs/l*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

37 lines
697 B
Diff

Source: Debian
This fixes build on big endian.
--- a/lwip-v6/src/include/ipv6/lwip/inet.h
+++ b/lwip-v6/src/include/ipv6/lwip/inet.h
@@ -52,6 +52,8 @@
#ifndef __LWIP_INET_H__
#define __LWIP_INET_H__
+#include <arpa/inet.h>
+
#include "lwip/arch.h"
#include "lwip/opt.h"
@@ -80,21 +82,6 @@
/*--------------------------------------------------------------------*/
-#ifndef htons
-
-#if BYTE_ORDER == BIG_ENDIAN
-#define htons(x) (x)
-#define ntohs(x) (x)
-#define htonl(x) (x)
-#define ntohl(x) (x)
-#else
-u16_t htons(u16_t x);
-u16_t ntohs(u16_t x);
-u32_t htonl(u32_t x);
-u32_t ntohl(u32_t x);
-#endif /* BYTE_ORDER == LITTLE_ENDIAN */
-
-#endif
#endif /* __LWIP_INET_H__ */