File: endian.h

package info (click to toggle)
syslinux 3%3A6.04~git20190206.bf6db5b4%2Bdfsg1-3.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie, trixie-proposed-updates
  • size: 17,020 kB
  • sloc: ansic: 189,354; asm: 5,148; pascal: 4,825; perl: 1,980; makefile: 1,980; python: 266; sh: 176; xml: 39
file content (38 lines) | stat: -rw-r--r-- 1,006 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * klibc/endian.h
 *
 * Like <endian.h>, but export only double-underscore symbols
 */

#ifndef _KLIBC_ENDIAN_H
#define _KLIBC_ENDIAN_H

#define __LITTLE_ENDIAN		/* we're on i386, littleendian */

/* Linux' asm/byteorder.h defines either __LITTLE_ENDIAN or
   __BIG_ENDIAN, but the glibc/BSD-ish macros expect both to be
   defined with __BYTE_ORDER defining which is actually used... */

#if defined(__LITTLE_ENDIAN)
# undef  __LITTLE_ENDIAN
# define __LITTLE_ENDIAN 1234
# define __BIG_ENDIAN    4321
# define __PDP_ENDIAN    3412
# define __BYTE_ORDER    __LITTLE_ENDIAN
#elif defined(__BIG_ENDIAN)
# undef  __BIG_ENDIAN
# define __LITTLE_ENDIAN 1234
# define __BIG_ENDIAN    4321
# define __PDP_ENDIAN    3412
# define __BYTE_ORDER    __BIG_ENDIAN
#elif defined(__PDP_ENDIAN)
# undef  __PDP_ENDIAN
# define __LITTLE_ENDIAN 1234
# define __BIG_ENDIAN    4321
# define __PDP_ENDIAN    3412
# define __BYTE_ORDER    __PDP_ENDIAN
#else
# error "Unknown byte order!"
#endif

#endif /* _KLIBC_ENDIAN_H */