utils: add endian_inl.h

moves the following to this header:
- htole*() definitions from bit_writer.c
- __BIG_ENDIAN__ fallback define from bit_reader_inl.h

Change-Id: I7fff59543f08a70bf8f9ddac849b72ed290471b1
This commit is contained in:
James Zern
2014-07-03 10:41:37 -07:00
parent 58ab622437
commit d5104b1ff6
5 changed files with 60 additions and 39 deletions

View File

@ -17,6 +17,7 @@
#define WEBP_UTILS_BIT_READER_INL_H_
#include "./bit_reader.h"
#include "./endian_inl.h"
#ifdef __cplusplus
extern "C" {
@ -35,12 +36,6 @@ typedef uint16_t lbit_t;
typedef uint8_t lbit_t;
#endif
// some endian fix (e.g.: mips-gcc doesn't define __BIG_ENDIAN__)
#if !defined(__BIG_ENDIAN__) && defined(__BYTE_ORDER__) && \
(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
#define __BIG_ENDIAN__
#endif
// gcc 4.3 has builtin functions for swap32/swap64
#if defined(__GNUC__) && \
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))