1
1
/* Compatibility macros for old and new Alpha complex float ABI.
2
Copyright (C) 2004 Free Software Foundation, Inc.
2
Copyright (C) 2004-2012 Free Software Foundation, Inc.
3
3
This file is part of the GNU C Library.
5
5
The GNU C Library is free software; you can redistribute it and/or
13
13
Lesser General Public License for more details.
15
15
You should have received a copy of the GNU Lesser General Public
16
License along with the GNU C Library; if not, write to the Free
17
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
16
License along with the GNU C Library. If not, see
17
<http://www.gnu.org/licenses/>. */
20
19
/* The behaviour of complex float changed between GCC 3.3 and 3.4.
26
25
follow the official Tru64 ABI, which passes the components of a complex
27
26
as separate parameters. */
29
#if __GNUC_PREREQ(3,4)
30
typedef union { double d; _Complex float cf; } c1_compat;
28
typedef union { double d; _Complex float cf; } c1_compat;
31
29
# define c1_cfloat_decl(x) double x
32
30
# define c1_cfloat_real(x) __real__ c1_cfloat_value (x)
33
31
# define c1_cfloat_imag(x) __imag__ c1_cfloat_value (x)
34
32
# define c1_cfloat_value(x) (((c1_compat *)(void *)&x)->cf)
35
33
# define c1_cfloat_rettype double
36
34
# define c1_cfloat_return(x) ({ c1_compat _; _.cf = (x); _.d; })
37
36
# define c2_cfloat_decl(x) _Complex float x
38
37
# define c2_cfloat_real(x) __real__ x
39
38
# define c2_cfloat_imag(x) __imag__ x
40
39
# define c2_cfloat_value(x) x
41
40
# define c2_cfloat_rettype _Complex float
42
41
# define c2_cfloat_return(x) x
44
# define c1_cfloat_decl(x) _Complex float x
45
# define c1_cfloat_real(x) __real__ x
46
# define c1_cfloat_imag(x) __imag__ x
47
# define c1_cfloat_value(x) x
48
# define c1_cfloat_rettype _Complex float
49
# define c1_cfloat_return(x) x
50
# define c2_cfloat_decl(x) float x ## r, float x ## i
51
# define c2_cfloat_real(x) x ## r
52
# define c2_cfloat_imag(x) x ## i
53
# define c2_cfloat_value(x) \
54
({ _Complex float _; __real__ _ = x##r; __imag__ _ = x##i; _; })
55
# define c2_cfloat_rettype double _Complex
56
# define c2_cfloat_return(x) x
59
43
/* Get the proper symbol versions defined for each function. */