]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
d: Fix the build on hosts missing _MAX and _MAX macros.
authoribuclaw <ibuclaw@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 17 Apr 2019 06:02:01 +0000 (06:02 +0000)
committeribuclaw <ibuclaw@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 17 Apr 2019 06:02:01 +0000 (06:02 +0000)
gcc/d/ChangeLog:

2019-04-17  Iain Buclaw  <ibuclaw@gdcproject.org>

* d-system.h (POSIX): Define unix as POSIX.
(INT32_MAX, INT32_MIN, INT64_MIN, UINT32_MAX, UINT64_MAX): Provide
fallback definitions.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@270403 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/d/ChangeLog
gcc/d/d-system.h

index d0210ff43e8b5013e50ba47068aa7c604edb9933..5a622af34a2c9aa27b03b40512aa1c6e9e43c636 100644 (file)
@@ -1,3 +1,9 @@
+2019-04-17  Iain Buclaw  <ibuclaw@gdcproject.org>
+
+       * d-system.h (POSIX): Define unix as POSIX.
+       (INT32_MAX, INT32_MIN, INT64_MIN, UINT32_MAX, UINT64_MAX): Provide
+       fallback definitions.
+
 2019-04-16  Iain Buclaw  <ibuclaw@gdcproject.org>
 
        * Make-lang.in (d.mostyclean): Clean idgen and impcvgen.
index 142b03dc80f1a942b83ca787e2513ecc0529f76b..b6f4ee5302af897ccfc3716684262fc276c96b67 100644 (file)
@@ -25,7 +25,7 @@
 /* Used by the dmd front-end to determine if we have POSIX-style IO.  */
 #define POSIX (__linux__ || __GLIBC__ || __gnu_hurd__ || __APPLE__ \
               || __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ \
-              || __sun)
+              || __sun || __unix__)
 
 /* Forward assert invariants to gcc_assert.  */
 #undef assert
 #define _mkdir(p) mkdir(p, 0)
 #endif
 
+/* Define any missing _MAX and _MIN macros.  */
+#ifndef INT32_MAX
+# define INT32_MAX INTTYPE_MAXIMUM (int32_t)
+#endif
+#ifndef INT32_MIN
+# define INT32_MIN INTTYPE_MINIMUM (int32_t)
+#endif
+#ifndef INT64_MIN
+# define INT64_MIN INTTYPE_MINIMUM (int64_t)
+#endif
+#ifndef UINT32_MAX
+# define UINT32_MAX INTTYPE_MAXIMUM (uint32_t)
+#endif
+#ifndef UINT64_MAX
+# define UINT64_MAX INTTYPE_MAXIMUM (uint64_t)
+#endif
+
 #endif  /* GCC_D_SYSTEM_H  */