diff options
Diffstat (limited to 'include/Support/DataTypes.h')
-rw-r--r-- | include/Support/DataTypes.h | 58 |
1 files changed, 6 insertions, 52 deletions
diff --git a/include/Support/DataTypes.h b/include/Support/DataTypes.h index 80543c6140..2f6724c4fb 100644 --- a/include/Support/DataTypes.h +++ b/include/Support/DataTypes.h @@ -13,65 +13,19 @@ // //===----------------------------------------------------------------------===// -// TODO: This file sucks. Not only does it not work, but this stuff should be -// autoconfiscated anyways. Major FIXME - #ifndef SUPPORT_DATATYPES_H #define SUPPORT_DATATYPES_H -#define __STDC_LIMIT_MACROS 1 -#include <inttypes.h> - -#ifdef __linux__ -# include <endian.h> -# if BYTE_ORDER == LITTLE_ENDIAN -# undef BIG_ENDIAN -# else -# undef LITTLE_ENDIAN -# endif -#endif - -#ifdef __FreeBSD__ -# include <machine/endian.h> -# if _BYTE_ORDER == _LITTLE_ENDIAN -# ifndef LITTLE_ENDIAN -# define LITTLE_ENDIAN 1 -# endif -# ifdef BIG_ENDIAN -# undef BIG_ENDIAN -# endif -# else -# ifndef BIG_ENDIAN -# define BIG_ENDIAN 1 -# endif -# ifdef LITTLE_ENDIAN -# undef LITTLE_ENDIAN -# endif -# endif -#endif +#include "Config/config.h" -#ifdef __sparc__ -# include <sys/types.h> -# ifdef _LITTLE_ENDIAN -# define LITTLE_ENDIAN 1 -# else -# define BIG_ENDIAN 1 -# endif -#endif +#define __STDC_LIMIT_MACROS 1 -// -// Convert the information from the header files into our own local -// endian macros. We do this because various strange systems define both -// BIG_ENDIAN and LITTLE_ENDIAN, and we don't want to conflict with them. -// -// Don't worry; once we introduce autoconf, this will look a lot nicer. -// -#ifdef LITTLE_ENDIAN -#define ENDIAN_LITTLE +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> #endif -#ifdef BIG_ENDIAN -#define ENDIAN_BIG +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> #endif #if (defined(ENDIAN_LITTLE) && defined(ENDIAN_BIG)) |