Skip to content

Commit 6c2605e

Browse files
committed
Fix test for reductions on win (IV)
1 parent 686da56 commit 6c2605e

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

tests/test_reductions.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,19 @@ static inline float _Complex make_c64(float real, float imag) {
1515
u.m = _FCbuild(real, imag);
1616
return u.c;
1717
}
18+
static inline float crealf_compat(float _Complex z) {
19+
union { float _Complex c; _Fcomplex m; } u;
20+
u.c = z;
21+
return u.m._Val[0];
22+
}
23+
static inline float cimagf_compat(float _Complex z) {
24+
union { float _Complex c; _Fcomplex m; } u;
25+
u.c = z;
26+
return u.m._Val[1];
27+
}
1828
#define MAKE_C64(real, imag) make_c64((real), (imag))
19-
#define CREALF(z) ((float)(((_Fcomplex)(z))._Val[0]))
20-
#define CIMAGF(z) ((float)(((_Fcomplex)(z))._Val[1]))
29+
#define CREALF(z) crealf_compat((z))
30+
#define CIMAGF(z) cimagf_compat((z))
2131
#else
2232
#define MAKE_C64(real, imag) CMPLXF((real), (imag))
2333
#define CREALF(z) crealf(z)

0 commit comments

Comments
 (0)