diff options
| author | Wiimm <wiimm@wiimm.de> | 2020-11-30 16:16:56 +0100 |
|---|---|---|
| committer | Wiimm <wiimm@wiimm.de> | 2020-11-30 16:16:56 +0100 |
| commit | 9c0078c6b9c1309b48f9ece8b5cad1b9be9a75c5 (patch) | |
| tree | 0abd3b6a244076650e40a07e42adae9c2a6b2d8c /project/dclib/dclib-types.h | |
| parent | a0815499b2d9014695e6e261c909476729445360 (diff) | |
SZS v2.21a
Diffstat (limited to 'project/dclib/dclib-types.h')
| -rw-r--r-- | project/dclib/dclib-types.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/project/dclib/dclib-types.h b/project/dclib/dclib-types.h index 8631d9a..360c026 100644 --- a/project/dclib/dclib-types.h +++ b/project/dclib/dclib-types.h @@ -51,6 +51,22 @@ /////////////////////////////////////////////////////////////////////////////// /////////////// endian /////////////// /////////////////////////////////////////////////////////////////////////////// + +#undef IS_BIG_ENDIAN +#undef IS_LITTLE_ENDIAN + +#if __BYTE_ORDER == __BIG_ENDIAN + #define IS_BIG_ENDIAN 1 + #define IS_LITTLE_ENDIAN 0 +#elif __BYTE_ORDER == __LITTLE_ENDIAN + #define IS_BIG_ENDIAN 0 + #define IS_LITTLE_ENDIAN 1 +#else + #define IS_BIG_ENDIAN 0 + #define IS_LITTLE_ENDIAN 0 +#endif + +//----------------------------------------------------------------------------- // [[dcEndian_t]] typedef enum dcEndian_t @@ -63,7 +79,7 @@ typedef enum dcEndian_t //--- define local & reverse endian, if possible - #if __BYTE_ORDER == __LITTLE_ENDIAN || __BYTE_ORDER == __BIG_ENDIAN + #if IS_BIG_ENDIAN || IS_LITTLE_ENDIAN DC_LOCAL_ENDIAN = DC_DEFAULT_ENDIAN, DC_REVERSE_ENDIAN = DC_SECOND_ENDIAN, @@ -73,7 +89,7 @@ typedef enum dcEndian_t //--- define aliases for little & big endian - #if __BYTE_ORDER == __BIG_ENDIAN + #if IS_BIG_ENDIAN DC_BIG_ENDIAN = DC_DEFAULT_ENDIAN, DC_LITTLE_ENDIAN = DC_SECOND_ENDIAN, |
