diff --git a/include/llvm/Support/DataTypesFix.h b/include/llvm/Support/AIXDataTypesFix.h similarity index 70% rename from include/llvm/Support/DataTypesFix.h rename to include/llvm/Support/AIXDataTypesFix.h index c73998d1d3f..36b4488841e 100644 --- a/include/llvm/Support/DataTypesFix.h +++ b/include/llvm/Support/AIXDataTypesFix.h @@ -1,4 +1,4 @@ -//===-- include/Support/DataTypesFix.h - Fix datatype defs ------*- C++ -*-===// +//===-- include/Support/AIXDataTypesFix.h - Fix datatype defs ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -13,17 +13,13 @@ // //===----------------------------------------------------------------------===// -#ifndef SUPPORT_DATATYPESFIX_H -#define SUPPORT_DATATYPESFIX_H +// No include guards desired! -#include "llvm/Config/config.h" - -#if defined(_POWER) && defined(_AIX) -// GCC is strict about defining large constants: they must have LL modifier. -#undef INT64_MAX -#define INT64_MAX 9223372036854775807LL -#undef INT64_MIN -#define INT64_MIN (-INT64_MAX-1) +#ifndef SUPPORT_DATATYPES_H +#error "AIXDataTypesFix.h must only be included via DataTypes.h!" #endif -#endif /* SUPPORT_DATATYPESFIX_H */ +// GCC is strict about defining large constants: they must have LL modifier. +// These will be defined properly at the end of DataTypes.h +#undef INT64_MAX +#undef INT64_MIN diff --git a/include/llvm/Support/DataTypes.h.in b/include/llvm/Support/DataTypes.h.in index f5467b2220f..4fc2d079ae4 100644 --- a/include/llvm/Support/DataTypes.h.in +++ b/include/llvm/Support/DataTypes.h.in @@ -49,8 +49,9 @@ #include #endif -// Fix AIX definitions of INT64_{MIN,MAX} -#include "llvm/Support/DataTypesFix.h" +#ifdef _AIX +#include "llvm/Support/AIXDataTypesFix.h" +#endif // Handle incorrect definition of uint64_t as u_int64_t #ifndef HAVE_UINT64_T