[PATCH v7 051/104] tests/tcg/multiarch/sha1.c: fix big endian implementation

Pierrick Bouvier <[email protected]>
Newsgroups gmane.comp.emulators.qemu
Message-ID <[email protected]>
Due to missing endian.h header, BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN
were undefined. Thus, for following code, the first branch was always
taken:
 #if BYTE_ORDER == LITTLE_ENDIAN
 #define blk0(i) (block->l[i] = (rol(block->l[i],24)&0xFF00FF00) \
     |(rol(block->l[i],8)&0x00FF00FF))
 #elif BYTE_ORDER == BIG_ENDIAN
 ...

Tested-by: Alex Bennée <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Pierrick Bouvier <[email protected]>
---
 tests/tcg/multiarch/sha1.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/tcg/multiarch/sha1.c b/tests/tcg/multiarch/sha1.c
index 0081bd76577..0fcbc3ed605 100644
--- a/tests/tcg/multiarch/sha1.c
+++ b/tests/tcg/multiarch/sha1.c
@@ -21,6 +21,7 @@ A million repetitions of "a"
 
 #define SHA1HANDSOFF
 
+#include <endian.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdint.h>
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.