summaryrefslogtreecommitdiff
path: root/config.h
blob: 79a64b5b65436fad1ce2dc8079dd18626671a206 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Includes and defines for ccan files */

#if !defined(BYTE_ORDER) && !defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN)
 #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
  #include <machine/endian.h>
 #else
  #include <endian.h>
 #endif
#endif
#if BYTE_ORDER == LITTLE_ENDIAN
 #define HAVE_LITTLE_ENDIAN 1
 #define HAVE_BIG_ENDIAN 0
#elif BYTE_ORDER == BIG_ENDIAN
 #define HAVE_LITTLE_ENDIAN 0
 #define HAVE_BIG_ENDIAN 1
#else
 #error Unknown endian
#endif