mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-24 11:54:49 +00:00
Test on big endian CPU architectures
This commit is contained in:
1 parent
fb3b0ca6e3
commit
76f693e5d7
7 files changed
+56
-48
No files matched your search
+15
@@ -34,6 +34,21 @@
|
||||
#define MG_ARCH MG_ARCH_RP2040
|
||||
#endif
|
||||
|
||||
/*
|
||||
* clang with std=-c99 uses __LITTLE_ENDIAN, by default
|
||||
* while for ex, RTOS gcc - LITTLE_ENDIAN, by default
|
||||
* it depends on __USE_BSD, but let's have everything
|
||||
*/
|
||||
#if !defined(BYTE_ORDER) && defined(__BYTE_ORDER)
|
||||
#define BYTE_ORDER __BYTE_ORDER
|
||||
#ifndef LITTLE_ENDIAN
|
||||
#define LITTLE_ENDIAN __LITTLE_ENDIAN
|
||||
#endif /* LITTLE_ENDIAN */
|
||||
#ifndef BIG_ENDIAN
|
||||
#define BIG_ENDIAN __LITTLE_ENDIAN
|
||||
#endif /* BIG_ENDIAN */
|
||||
#endif /* BYTE_ORDER */
|
||||
|
||||
#if !defined(MG_ARCH)
|
||||
#include "mongoose_custom.h" // keep this include
|
||||
#endif
|
||||
|
||||
@@ -2,15 +2,6 @@
|
||||
#include "arch.h"
|
||||
|
||||
#if defined(MG_ENABLE_MD5) && MG_ENABLE_MD5
|
||||
#if !defined(BYTE_ORDER) && defined(__BYTE_ORDER)
|
||||
#define BYTE_ORDER __BYTE_ORDER
|
||||
#ifndef LITTLE_ENDIAN
|
||||
#define LITTLE_ENDIAN __LITTLE_ENDIAN
|
||||
#endif /* LITTLE_ENDIAN */
|
||||
#ifndef BIG_ENDIAN
|
||||
#define BIG_ENDIAN __LITTLE_ENDIAN
|
||||
#endif /* BIG_ENDIAN */
|
||||
#endif /* BYTE_ORDER */
|
||||
|
||||
static void mg_byte_reverse(unsigned char *buf, unsigned longs) {
|
||||
/* Forrest: MD5 expect LITTLE_ENDIAN, swap if BIG_ENDIAN */
|
||||
|
||||
-15
@@ -3,21 +3,6 @@
|
||||
#include "sha1.h"
|
||||
#include "arch.h"
|
||||
|
||||
/*
|
||||
* clang with std=-c99 uses __LITTLE_ENDIAN, by default
|
||||
* while for ex, RTOS gcc - LITTLE_ENDIAN, by default
|
||||
* it depends on __USE_BSD, but let's have everything
|
||||
*/
|
||||
#if !defined(BYTE_ORDER) && defined(__BYTE_ORDER)
|
||||
#define BYTE_ORDER __BYTE_ORDER
|
||||
#ifndef LITTLE_ENDIAN
|
||||
#define LITTLE_ENDIAN __LITTLE_ENDIAN
|
||||
#endif /* LITTLE_ENDIAN */
|
||||
#ifndef BIG_ENDIAN
|
||||
#define BIG_ENDIAN __LITTLE_ENDIAN
|
||||
#endif /* BIG_ENDIAN */
|
||||
#endif /* BYTE_ORDER */
|
||||
|
||||
union char64long16 {
|
||||
unsigned char c[64];
|
||||
uint32_t l[16];
|
||||
|
||||
Reference in new issue
Block a user