projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
efa9d39
)
provide CMPLX macros in implementation-internal libm.h
author
Rich Felker
<dalias@aerifal.cx>
Wed, 17 Dec 2014 21:08:50 +0000
(16:08 -0500)
committer
Rich Felker
<dalias@aerifal.cx>
Wed, 17 Dec 2014 21:08:50 +0000
(16:08 -0500)
this avoids assuming the presence of C11 macro definitions in the
public complex.h, which need changes potentially incompatible with the
way these macros are being used internally.
src/internal/libm.h
patch
|
blob
|
history
diff --git
a/src/internal/libm.h
b/src/internal/libm.h
index ebcd78498d0e1ba2a0ad2937435457ef74793019..88a7eb479e53e9253adbe08f79481d64f66946b6 100644
(file)
--- a/
src/internal/libm.h
+++ b/
src/internal/libm.h
@@
-128,6
+128,18
@@
do { \
(d) = __u.f; \
} while (0)
+#undef __CMPLX
+#undef CMPLX
+#undef CMPLXF
+#undef CMPLXL
+
+#define __CMPLX(x, y, t) \
+ ((union { _Complex t __z; t __xy[2]; }){.__xy = {(x),(y)}}.__z)
+
+#define CMPLX(x, y) __CMPLX(x, y, double)
+#define CMPLXF(x, y) __CMPLX(x, y, float)
+#define CMPLXL(x, y) __CMPLX(x, y, long double)
+
/* fdlibm kernel functions */
int __rem_pio2_large(double*,double*,int,int,int);