medfall

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

endianness.h (432B)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef _ENDIANNESS_H_
#define _ENDIANNESS_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 defined( _WIN32 )
#  define IS_LITTLE_ENDIAN
#endif

#endif // _ENDIANNESS_H_