diff --git a/dmd/expression.c b/dmd/expression.c index a630b819..4a118fac 100644 --- a/dmd/expression.c +++ b/dmd/expression.c @@ -1498,7 +1498,7 @@ int RealEquals(real_t x1, real_t x2) /* In some cases, the REALPAD bytes get garbage in them, * so be sure and ignore them. */ - memcmp(&x1, &x2, sizeof(real_t)) == 0; + memcmp(&x1, &x2, REAL_T_SIZE - REAL_T_PAD) == 0; } int RealExp::equals(Object *o) diff --git a/dmd/mars.h b/dmd/mars.h index 037087e7..e5115b5b 100644 --- a/dmd/mars.h +++ b/dmd/mars.h @@ -213,6 +213,8 @@ typedef d_uns32 d_dchar; #include "d-gcc-real.h" #else typedef long double real_t; +#define REAL_T_SIZE 12 +#define REAL_T_PAD 2 #endif // Modify OutBuffer::writewchar to write the correct size of wchar