mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-18 22:03:14 +01:00
Make RealEquals only compare the data bytes.
Fixes run/t/template_class_13_* regressions introduced in [r401].
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user