-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20313 from maribu/sys/byteorder/cleanup-implement…
…ation sys/byteorder: clean up implementation
- Loading branch information
Showing
18 changed files
with
189 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
|
||
# This function removes type qualifiers from anonymous padding fields in bit | ||
# fields for compatibility with clang++. | ||
strip_type_qualifiers_from_bit_fields() { | ||
echo "Searching for header files with bogus type qualifiers" | ||
offenders="$(grep -Erl '__I [u]*int[0-9]*_t[ \t]*:[0-9]*;')" | ||
|
||
for file in $offenders; do | ||
echo "Sanitizing $file for type qualifiers in padding" | ||
sed -i "$file" -e 's/__I \([u]*int[0-9]*_t[\t ]*:[0-9]*;\)/\1 /g' | ||
done | ||
} | ||
|
||
# This functions removes a bogus `LITTLE_ENDIAN` define which conflicts with | ||
# <endian.h> and tinyDTLS notion of it. Luckily, that define is not used | ||
# anywhere in the vendor header files, so we can just drop it. | ||
remove_bogus_endian_define() { | ||
echo "Searching for header files with bogus LITTLE_ENDIAN define" | ||
offenders="$(grep -rl '^#define LITTLE_ENDIAN')" | ||
|
||
for file in $offenders; do | ||
echo "Removing bogus LITTLE_ENDIAN define from $file" | ||
sed -i "$file" -e '/^#define LITTLE_ENDIAN/d' | ||
done | ||
} | ||
|
||
strip_type_qualifiers_from_bit_fields | ||
remove_bogus_endian_define |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
pkg/esp8266_sdk/patches/0002-components-lwip-port-esp8266-use-endian.h.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
From 64a9b435bcc38a11568854f31845e58f11a0001e Mon Sep 17 00:00:00 2001 | ||
From: Marian Buschsieweke <marian.buschsieweke@posteo.net> | ||
Date: Thu, 1 Feb 2024 18:22:27 +0100 | ||
Subject: [PATCH] components/lwip/port/esp8266: use <endian.h> | ||
|
||
Now that there is an `<endian.h>`, it can be used :) | ||
--- | ||
components/lwip/port/esp8266/include/arch/cc.h | 6 +----- | ||
1 file changed, 1 insertion(+), 5 deletions(-) | ||
|
||
diff --git a/components/lwip/port/esp8266/include/arch/cc.h b/components/lwip/port/esp8266/include/arch/cc.h | ||
index c815a67..1648fc0 100644 | ||
--- a/components/lwip/port/esp8266/include/arch/cc.h | ||
+++ b/components/lwip/port/esp8266/include/arch/cc.h | ||
@@ -38,11 +38,7 @@ | ||
|
||
#define LWIP_ERRNO_INCLUDE "sys/errno.h" | ||
|
||
-#if (1) | ||
-#define BYTE_ORDER LITTLE_ENDIAN | ||
-#else | ||
-#define BYTE_ORDER BIG_ENDIAN | ||
-#endif | ||
+#include <endian.h> | ||
|
||
typedef int sys_prot_t; | ||
|
||
-- | ||
2.43.0 | ||
|
44 changes: 44 additions & 0 deletions
44
pkg/tinydtls/patches/0002-platform-specific-riot_boards.h-fix-conflict-with-en.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
From 9b62250bf6561aed372429eb551bd75f8f5fde16 Mon Sep 17 00:00:00 2001 | ||
From: Marian Buschsieweke <marian.buschsieweke@posteo.net> | ||
Date: Wed, 31 Jan 2024 17:58:13 +0100 | ||
Subject: [PATCH] platform-specific/riot_boards.h: fix conflict with endian.h | ||
|
||
--- | ||
platform-specific/riot_boards.h | 23 ----------------------- | ||
1 file changed, 23 deletions(-) | ||
|
||
diff --git a/platform-specific/riot_boards.h b/platform-specific/riot_boards.h | ||
index f18e5ae..d7680d5 100644 | ||
--- a/platform-specific/riot_boards.h | ||
+++ b/platform-specific/riot_boards.h | ||
@@ -126,27 +126,4 @@ | ||
/* RIOT "supports" memset()/memcpy() BUT not bzero()/mcopy(). */ | ||
#define SHA2_USE_MEMSET_MEMCPY 1 | ||
|
||
- | ||
-/* | ||
- * NOTE Gcc is who define if we are big endian or little endian. | ||
- * Because RIOT has __BYTE_ORDER__ and BYTE_ORDER it is not clear which one | ||
- * should take preference here. Or, if the #define inside of sha2/sha2.h | ||
- * should be removed at all. | ||
- */ | ||
-#ifndef BIG_ENDIAN | ||
-#if !defined(__BIG_ENDIAN__) | ||
-# define BIG_ENDIAN 4321 | ||
-# else | ||
-# define BIG_ENDIAN __BIG_ENDIAN__ | ||
-# endif | ||
-#endif | ||
- | ||
-#ifndef LITTLE_ENDIAN | ||
-#if !defined(__LITTLE_ENDIAN__) | ||
-# define LITTLE_ENDIAN 1234 | ||
-# else | ||
-# define LITTLE_ENDIAN __LITTLE_ENDIAN__ | ||
-# endif | ||
-#endif | ||
- | ||
#endif /* _RIOT_BOARDS_H_ */ | ||
-- | ||
2.43.0 | ||
|
Oops, something went wrong.