[llvm-commits] CVS: llvm/include/Support/DataTypes.h
Chris Lattner
lattner at cs.uiuc.edu
Fri Sep 13 16:52:00 PDT 2002
Changes in directory llvm/include/Support:
DataTypes.h updated: 1.3 -> 1.4
---
Log message:
Try to work well on multiple platforms.
---
Diffs of the changes:
Index: llvm/include/Support/DataTypes.h
diff -u llvm/include/Support/DataTypes.h:1.3 llvm/include/Support/DataTypes.h:1.4
--- llvm/include/Support/DataTypes.h:1.3 Fri Sep 13 10:37:58 2002
+++ llvm/include/Support/DataTypes.h Fri Sep 13 16:51:25 2002
@@ -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 <inttypes.h>
#ifdef __linux__
-#define __STDC_LIMIT_MACROS 1
-#include <stdint.h> // Defined by ISO C 99
#include <endian.h>
+#endif
-#else
+#ifdef __sparc__
#include <sys/types.h>
#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 */
More information about the llvm-commits
mailing list