Mercurial > hg > th-libs
changeset 52:2a452b142301
Byteorder changes.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 09 Oct 2011 23:03:40 +0300 |
parents | 1607c0691dee |
children | 2c90b33d3617 |
files | th_endian.h |
diffstat | 1 files changed, 9 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/th_endian.h Sun Oct 09 22:37:58 2011 +0300 +++ b/th_endian.h Sun Oct 09 23:03:40 2011 +0300 @@ -18,6 +18,15 @@ extern "C" { #endif +/* Check endianess + */ +#ifndef TH_BYTEORDER +# error Undefined byteorder (TH_BYTEORDER not set.) +#endif + +#define TH_BIG_ENDIAN 1234 +#define TH_LITTLE_ENDIAN 4321 + /* Endianess swapping macros */ @@ -46,10 +55,6 @@ /* Macros that swap only when needed ... */ -#ifndef TH_BYTEORDER -# error Undefined byteorder (TH_BYTEORDER not set.) -#endif - #if (TH_BYTEORDER == TH_BIG_ENDIAN) #define TH_LE16_TO_NATIVE(value) TH_SWAP_16_LE_BE(value)