diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2019-04-17 06:02:01 +0000 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gcc.gnu.org> | 2019-04-17 06:02:01 +0000 |
commit | 347ef24548b81cd6ad795eb06b87eb041dd6feae (patch) | |
tree | 783b27f772e9036d6881c94b75d39f1557a2c084 /gcc/d | |
parent | 1b02929ad0f1629a1e307a157add5f345d7d43c5 (diff) | |
download | gcc-347ef24548b81cd6ad795eb06b87eb041dd6feae.zip gcc-347ef24548b81cd6ad795eb06b87eb041dd6feae.tar.gz gcc-347ef24548b81cd6ad795eb06b87eb041dd6feae.tar.bz2 |
d: Fix the build on hosts missing _MAX and _MAX macros.
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.
From-SVN: r270403
Diffstat (limited to 'gcc/d')
-rw-r--r-- | gcc/d/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/d/d-system.h | 19 |
2 files changed, 24 insertions, 1 deletions
diff --git a/gcc/d/ChangeLog b/gcc/d/ChangeLog index d0210ff..5a622af 100644 --- a/gcc/d/ChangeLog +++ b/gcc/d/ChangeLog @@ -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. diff --git a/gcc/d/d-system.h b/gcc/d/d-system.h index 142b03d..b6f4ee5 100644 --- a/gcc/d/d-system.h +++ b/gcc/d/d-system.h @@ -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 @@ -61,4 +61,21 @@ #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 */ |