medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 66f7dec877e52d4ccfd035da8ea62964ff5fd1a0
parent cdbb4b5045c3a748b09cd6df33e40324ff05c69d
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sun Mar  6 21:13:20 +0000

Add endian.h

Diffstat:
endian.h | 16++++++++++++++++
1 file changed, 16 insertions(+), 0 deletions(-)
diff --git a/endian.h b/endian.h @@ -0,0 +1,16 @@ +#ifndef _ENDIAN_H_ +#define _ENDIAN_H_ + +#if defined( __linux__) || defined( __APPLE__ ) || defined( __OpenBSD__ ) +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#define IS_LITTLE_ENDIAN +#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#define IS_BIG_ENDIAN +#else +#error "I can't tell what byte order this machine uses" +#endif +#elif _WIN32 +#define IS_LITTLE_ENDIAN +#endif + +#endif // _ENDIAN_H_