aboutsummaryrefslogtreecommitdiff
path: root/lib/builtins/int_types.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/builtins/int_types.h')
-rw-r--r--lib/builtins/int_types.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/builtins/int_types.h b/lib/builtins/int_types.h
index aedae14b2046..2dad43bc7389 100644
--- a/lib/builtins/int_types.h
+++ b/lib/builtins/int_types.h
@@ -20,6 +20,10 @@
#include "int_endianness.h"
+/* si_int is defined in Linux sysroot's asm-generic/siginfo.h */
+#ifdef si_int
+#undef si_int
+#endif
typedef int si_int;
typedef unsigned su_int;
@@ -95,14 +99,14 @@ typedef union
}s;
} utwords;
-static inline ti_int make_ti(di_int h, di_int l) {
+static __inline ti_int make_ti(di_int h, di_int l) {
twords r;
r.s.high = h;
r.s.low = l;
return r.all;
}
-static inline tu_int make_tu(du_int h, du_int l) {
+static __inline tu_int make_tu(du_int h, du_int l) {
utwords r;
r.s.high = h;
r.s.low = l;
@@ -140,5 +144,22 @@ typedef union
long double f;
} long_double_bits;
+#if __STDC_VERSION__ >= 199901L
+typedef float _Complex Fcomplex;
+typedef double _Complex Dcomplex;
+typedef long double _Complex Lcomplex;
+
+#define COMPLEX_REAL(x) __real__(x)
+#define COMPLEX_IMAGINARY(x) __imag__(x)
+#else
+typedef struct { float real, imaginary; } Fcomplex;
+
+typedef struct { double real, imaginary; } Dcomplex;
+
+typedef struct { long double real, imaginary; } Lcomplex;
+
+#define COMPLEX_REAL(x) (x).real
+#define COMPLEX_IMAGINARY(x) (x).imaginary
+#endif
#endif /* INT_TYPES_H */