[llvm-commits] CVS: llvm/include/llvm/Support/DataTypes.h.in

Misha Brukman brukman at cs.uiuc.edu
Mon Oct 18 11:35:31 PDT 2004



Changes in directory llvm/include/llvm/Support:

DataTypes.h.in updated: 1.11 -> 1.12
---
Log message:

* AIX on Power defines INT64_MIN and INT64_MAX in ways that annoy GCC, so
  special-case those definitions
* Add comments in #ifdef/#else/#endif clauses for ease of reading


---
Diffs of the changes:  (+14 -3)

Index: llvm/include/llvm/Support/DataTypes.h.in
diff -u llvm/include/llvm/Support/DataTypes.h.in:1.11 llvm/include/llvm/Support/DataTypes.h.in:1.12
--- llvm/include/llvm/Support/DataTypes.h.in:1.11	Mon Oct  4 13:10:16 2004
+++ llvm/include/llvm/Support/DataTypes.h.in	Mon Oct 18 13:35:21 2004
@@ -49,6 +49,17 @@
 #include <stdint.h>
 #endif
 
+#if defined(_POWER) && defined(_AIX)
+// GCC is strict about defining large constants: they must have LL modifier.
+// We will catch INT64_MAX in the default case below.
+#undef INT64_MAX
+// AIX #defines INT64_MIN as (-INT64_MAX-1), or -9223372036854775808 which GCC
+// complains about as `integer constant is so large that it is unsigned', so
+// set INT64_MIN to be one above that:
+#undef INT64_MIN
+#define INT64_MIN -9223372036854775807LL
+#endif
+
 // Handle incorrect definition of uint64_t as u_int64_t
 #ifndef HAVE_UINT64_T
 #ifdef HAVE_U_INT64_T
@@ -58,7 +69,7 @@
 #endif
 #endif
 
-#else
+#else /* _MSC_VER */
 // Visual C++ doesn't provide standard integer headers, but it does provide
 // built-in data types.
 typedef __int64 int64_t;
@@ -75,10 +86,10 @@
 #define INT32_MAX 2147483647
 #define INT32_MIN -2147483648
 #define UINT32_MAX 4294967295U
-#endif
+#endif /* _MSC_VER */
 
+/* Set defaults for constants which we cannot find. */
 #if !defined(INT64_MAX)
-/* We couldn't determine INT64_MAX; default it. */
 # define INT64_MAX 9223372036854775807LL
 #endif
 #if !defined(UINT64_MAX)






More information about the llvm-commits mailing list