From: Chris Lattner Date: Fri, 13 Sep 2002 21:51:25 +0000 (+0000) Subject: Try to work well on multiple platforms. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9ada838909e3577e044b05835bc69e092fb799d4;p=oota-llvm.git Try to work well on multiple platforms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3704 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/Support/DataTypes.h b/include/Support/DataTypes.h index b1b88790ac6..66967619fc3 100644 --- a/include/Support/DataTypes.h +++ b/include/Support/DataTypes.h @@ -7,6 +7,7 @@ // LITTLE_ENDIAN: is #define'd if the host is little endian // int64_t : is a typedef for the signed 64 bit system type // uint64_t : is a typedef for the unsigned 64 bit system type +// INT64_MAX : is a #define specifying the max value for int64_t's // // No library is required when using these functinons. // @@ -15,22 +16,29 @@ // TODO: This file sucks. Not only does it not work, but this stuff should be // autoconfiscated anyways. Major FIXME - #ifndef LLVM_SUPPORT_DATATYPES_H #define LLVM_SUPPORT_DATATYPES_H +#define __STDC_LIMIT_MACROS 1 #include #ifdef __linux__ -#define __STDC_LIMIT_MACROS 1 -#include // Defined by ISO C 99 #include +#endif -#else +#ifdef __sparc__ #include #ifdef _LITTLE_ENDIAN #define LITTLE_ENDIAN 1 +#else +#define BIG_ENDIAN 1 #endif #endif +#ifndef LITTLE_ENDIAN +#if !defined(BIG_ENDIAN) || !defined(INT64_MAX) +#error "include/Support/DataTypes.h could not determine endianness!" #endif +#endif + +#endif /* LLVM_SUPPORT_DATATYPES_H */