mirror of git://git.musl-libc.org/musl
make the definition of _Complex_I explicitly complex
it's unclear whether compilers which provide pure imaginary types might produce a pure imaginary expression for 1.0fi. using 0.0f+1.0fi ensures that the result is explicitly complex and makes this obvious to human readers too.
This commit is contained in:
parent
4075af4318
commit
a9c2294eef
|
@ -7,9 +7,9 @@ extern "C" {
|
||||||
|
|
||||||
#define complex _Complex
|
#define complex _Complex
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define _Complex_I (__extension__ 1.0fi)
|
#define _Complex_I (__extension__ (0.0f+1.0fi))
|
||||||
#else
|
#else
|
||||||
#define _Complex_I 1.0fi
|
#define _Complex_I (0.0f+1.0fi)
|
||||||
#endif
|
#endif
|
||||||
#define I _Complex_I
|
#define I _Complex_I
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue