#include "bfd.h"
 
 #include <sys/types.h>
-#include <limits.h>
+#include <climits>
 
 /* The libdecnumber library, on which GDB depends, includes a header file
    called gstdint.h instead of relying directly on stdint.h.  GDB, on the
 # include "fopen-bin.h"
 #endif
 
-/* Defaults for system-wide constants (if not defined by xm.h, we fake it).
-   FIXME: Assumes 2's complement arithmetic.  */
-
-#if !defined (UINT_MAX)
-#define        UINT_MAX ((unsigned int)(~0))       /* 0xFFFFFFFF for 32-bits */
-#endif
-
-#if !defined (INT_MAX)
-#define        INT_MAX ((int)(UINT_MAX >> 1))      /* 0x7FFFFFFF for 32-bits */
-#endif
-
-#if !defined (INT_MIN)
-#define INT_MIN ((int)((int) ~0 ^ INT_MAX)) /* 0x80000000 for 32-bits */
-#endif
-
-#if !defined (ULONG_MAX)
-#define        ULONG_MAX ((unsigned long)(~0L))    /* 0xFFFFFFFF for 32-bits */
-#endif
-
-#if !defined (LONG_MAX)
-#define        LONG_MAX ((long)(ULONG_MAX >> 1))   /* 0x7FFFFFFF for 32-bits */
-#endif
-
-#if !defined (ULONGEST_MAX)
-#define        ULONGEST_MAX (~(ULONGEST)0)        /* 0xFFFFFFFFFFFFFFFF for 64-bits */
-#endif
-
-#if !defined (LONGEST_MAX)                 /* 0x7FFFFFFFFFFFFFFF for 64-bits */
-#define        LONGEST_MAX ((LONGEST)(ULONGEST_MAX >> 1))
-#endif
-
 /* * Convert a LONGEST to an int.  This is used in contexts (e.g. number of
    arguments to a function, number in a value history, register number, etc.)
    where the value must not be larger than can fit in an int.  */
 
 /* * The largest CORE_ADDR value.  */
 #define CORE_ADDR_MAX (~(CORE_ADDR) 0)
 
-/* * The largest ULONGEST value.  */
+/* * The largest ULONGEST value, 0xFFFFFFFFFFFFFFFF for 64-bits.  */
 #define ULONGEST_MAX (~(ULONGEST) 0)
 
+/* * The largest LONGEST value, 0x7FFFFFFFFFFFFFFF for 64-bits.  */
+#define LONGEST_MAX ((LONGEST) (ULONGEST_MAX >> 1))
+
+/* * The smallest LONGEST value, 0x8000000000000000 for 64-bits.  */
+#define LONGEST_MIN ((LONGEST) (~(LONGEST) 0 ^ LONGEST_MAX))
+
 enum tribool { TRIBOOL_UNKNOWN = -1, TRIBOOL_FALSE = 0, TRIBOOL_TRUE = 1 };
 
 #endif /* COMMON_COMMON_TYPES_H */