Add headers for endianess

This commit is contained in:
mio
2022-10-27 22:51:56 +02:00
parent da3999b6f0
commit fb8fb1ca7a
3 changed files with 136 additions and 0 deletions

View File

@@ -5,6 +5,8 @@
#include <stdint.h>
#include <unicorn/unicorn.h>
#include "acutest.h"
#include "endian.h"
#include "bswap.h"
/**
* Assert that err matches expect
@@ -22,4 +24,16 @@
*/
#define OK(stat) uc_assert_err(UC_ERR_OK, stat)
#ifdef BOOST_LITTLE_ENDIAN
#define LEINT32(x) (x)
#define LEINT64(x) (x)
#define BEINT32(x) (bswap_32(x))
#define BEINT64(x) (bswap_64(x))
#else
#define LEINT32(x) (bswap_32(x))
#define LEINT64(x) (bswap_64(x))
#define BEINT32(x) (x)
#define BEINT64(x) (x)
#endif
#endif /* UNICORN_TEST_H */