]>
Commit | Line | Data |
---|---|---|
4cca6b86 UD |
1 | /* Copyright (C) 1997 Free Software Foundation, Inc. |
2 | This file is part of the GNU C Library. | |
3 | ||
4 | The GNU C Library is free software; you can redistribute it and/or | |
5 | modify it under the terms of the GNU Library General Public License as | |
6 | published by the Free Software Foundation; either version 2 of the | |
7 | License, or (at your option) any later version. | |
8 | ||
9 | The GNU C Library is distributed in the hope that it will be useful, | |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | Library General Public License for more details. | |
13 | ||
14 | You should have received a copy of the GNU Library General Public | |
15 | License along with the GNU C Library; see the file COPYING.LIB. If not, | |
16 | write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
17 | Boston, MA 02111-1307, USA. */ | |
18 | ||
19 | /* | |
20 | * ISO C 9X: 7.8 Complex arithmetic <complex.h> | |
21 | */ | |
22 | ||
23 | #ifndef _COMPLEX_H | |
24 | #define _COMPLEX_H 1 | |
5107cf1d | 25 | |
993b3242 UD |
26 | #include <features.h> |
27 | ||
28 | __BEGIN_DECLS | |
4cca6b86 UD |
29 | |
30 | /* We might need to add support for more compilers here. But once ISO | |
31 | C 9X is out hopefully all maintained compilers will provide the data | |
32 | types `float complex' and `double complex'. */ | |
33 | #if (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ > 2 | |
34 | # define complex __complex__ | |
35 | #endif | |
36 | ||
37 | ||
38 | /* Narrowest imaginary unit. This depends on the floating-point | |
39 | evaluation method. | |
40 | XXX This probably has to go into a gcc related file. */ | |
cc3fa755 | 41 | #define _Complex_I (1.0iF) |
4cca6b86 | 42 | |
fe0ec73e UD |
43 | /* Another more descriptive name is `I'. |
44 | XXX Once we have the imaginary support switch this to _Imaginary_I. */ | |
4cca6b86 | 45 | #undef I |
fe0ec73e | 46 | #define I _Complex_I |
4cca6b86 UD |
47 | |
48 | ||
993b3242 | 49 | /* Optimization aids. This is not yet implemented in gcc and once it |
4cca6b86 UD |
50 | is this will probably be available in a gcc header. */ |
51 | #define CX_LIMITED_RANGE_ON | |
52 | #define CX_LIMITED_RANGE_OFF | |
53 | #define CX_LIMITED_RANGE_DEFAULT | |
54 | ||
55 | ||
5107cf1d UD |
56 | /* The file <bits/cmathcalls.h> contains the prototypes for all the |
57 | actual math functions. These macros are used for those prototypes, | |
58 | so we can easily declare each function as both `name' and `__name', | |
4cca6b86 UD |
59 | and can declare the float versions `namef' and `__namef'. */ |
60 | ||
61 | #define __MATHCALL(function, args) \ | |
62 | __MATHDECL (_Mdouble_complex_,function, args) | |
63 | #define __MATHDECL(type, function, args) \ | |
64 | __MATHDECL_1(type, function, args); \ | |
65 | __MATHDECL_1(type, __CONCAT(__,function), args) | |
66 | #define __MATHDECL_1(type, function, args) \ | |
67 | extern type __MATH_PRECNAME(function) args | |
68 | ||
69 | #define _Mdouble_ double | |
70 | #define __MATH_PRECNAME(name) name | |
5107cf1d | 71 | #include <bits/cmathcalls.h> |
4cca6b86 UD |
72 | #undef _Mdouble_ |
73 | #undef __MATH_PRECNAME | |
74 | ||
75 | /* Now the float versions. */ | |
76 | #ifndef _Mfloat_ | |
77 | #define _Mfloat_ float | |
78 | #endif | |
79 | #define _Mdouble_ _Mfloat_ | |
80 | #ifdef __STDC__ | |
81 | #define __MATH_PRECNAME(name) name##f | |
82 | #else | |
83 | #define __MATH_PRECNAME(name) name/**/f | |
84 | #endif | |
5107cf1d | 85 | #include <bits/cmathcalls.h> |
4cca6b86 UD |
86 | #undef _Mdouble_ |
87 | #undef __MATH_PRECNAME | |
88 | ||
89 | /* And the long double versions. It is non-critical to define them | |
90 | here unconditionally since `long double' is required in ISO C 9X. */ | |
91 | #ifndef _Mlong_double_ | |
92 | #define _Mlong_double_ long double | |
93 | #endif | |
94 | #define _Mdouble_ _Mlong_double_ | |
95 | #ifdef __STDC__ | |
96 | #define __MATH_PRECNAME(name) name##l | |
97 | #else | |
98 | #define __MATH_PRECNAME(name) name/**/l | |
99 | #endif | |
5107cf1d | 100 | #include <bits/cmathcalls.h> |
4cca6b86 UD |
101 | #undef _Mdouble_ |
102 | #undef __MATH_PRECNAME | |
103 | #undef __MATHDECL_1 | |
104 | #undef __MATHDECL | |
105 | #undef __MATHCALL | |
106 | ||
993b3242 UD |
107 | __END_DECLS |
108 | ||
4cca6b86 | 109 | #endif /* complex.h */ |