2222d0559d
and types.h. The idea is to provide a basic architecture/compiler abstraction by defining types and macros that allow the posix/ and os/ headers to be mostly architecture/compiler agnostic. * Adjusted the posix/ and os/ headers accordingly. * <SupportDefs.h>: Introduced B_PRI* and B_SCN* macros similar to the PRI* and SCN* macros defined in <inttypes.h>, just for the BeOS/Haiku [u]int* types and some POSIX types (e.g. off_t, dev_t, ino_t) that don't have POSIX macros. Also the B_PRI* and B_SCN* macros are available unconditionally, unlike the <inttypes.h> macros, which require __STDC_FORMAT_MACROS to be defined in C++ mode. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34214 a95241bf-73f2-0310-859d-f6bbb57e9c96
32 lines
730 B
C
32 lines
730 B
C
/*
|
|
* Copyright 2003-2008 Haiku, Inc. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _ENDIAN_H_
|
|
#define _ENDIAN_H_
|
|
|
|
|
|
#include <config/HaikuConfig.h>
|
|
|
|
|
|
/* Defines architecture dependent endian constants.
|
|
* The constant reflects the byte order, "4" is the most
|
|
* significant byte, "1" the least significant one.
|
|
*/
|
|
|
|
#if defined(__HAIKU_LITTLE_ENDIAN)
|
|
# define LITTLE_ENDIAN 1234
|
|
# define BIG_ENDIAN 0
|
|
# define BYTE_ORDER LITTLE_ENDIAN
|
|
#elif defined(__HAIKU_BIG_ENDIAN)
|
|
# define BIG_ENDIAN 4321
|
|
# define LITTLE_ENDIAN 0
|
|
# define BYTE_ORDER BIG_ENDIAN
|
|
#endif
|
|
|
|
#define __BIG_ENDIAN BIG_ENDIAN
|
|
#define __LITTLE_ENDIAN LITTLE_ENDIAN
|
|
#define __BYTE_ORDER BYTE_ORDER
|
|
|
|
#endif /* _ENDIAN_H_ */
|