Chameleon

Chameleon Svn Source Tree

Root/branches/meklort/i386/modules/include/klibc/endian.h

Source at commit 660 created 13 years 4 months ago.
By meklort, Added includes dir for modules (c++ includes only at the moment, may ad klibc includes later on). Includes path is now included for modules
1/*
2 * klibc/endian.h
3 *
4 * Like <endian.h>, but export only double-underscore symbols
5 */
6
7#ifndef _KLIBC_ENDIAN_H
8#define _KLIBC_ENDIAN_H
9
10#include <klibc/compiler.h>
11#include <asm/byteorder.h>
12
13/* Linux' asm/byteorder.h defines either __LITTLE_ENDIAN or
14 __BIG_ENDIAN, but the glibc/BSD-ish macros expect both to be
15 defined with __BYTE_ORDER defining which is actually used... */
16
17#if defined(__LITTLE_ENDIAN)
18# undef __LITTLE_ENDIAN
19# define __LITTLE_ENDIAN 1234
20# define __BIG_ENDIAN 4321
21# define __PDP_ENDIAN 3412
22# define __BYTE_ORDER __LITTLE_ENDIAN
23#elif defined(__BIG_ENDIAN)
24# undef __BIG_ENDIAN
25# define __LITTLE_ENDIAN 1234
26# define __BIG_ENDIAN 4321
27# define __PDP_ENDIAN 3412
28# define __BYTE_ORDER __BIG_ENDIAN
29#elif defined(__PDP_ENDIAN)
30# undef __PDP_ENDIAN
31# define __LITTLE_ENDIAN 1234
32# define __BIG_ENDIAN 4321
33# define __PDP_ENDIAN 3412
34# define __BYTE_ORDER __PDP_ENDIAN
35#else
36# error "Unknown byte order!"
37#endif
38
39#endif/* _KLIBC_ENDIAN_H */
40

Archive Download this file

Revision: 660