April 2024 | ||||||
Mo | Tu | We | Th | Fr | Sa | Su |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
001: /* Copyright (C) 1997, 1998, 1999, 2000, 2006, 2011 Free Software Foundation, Inc. 002: This file is part of the GNU C Library. 003: 004: The GNU C Library is free software; you can redistribute it and/or 005: modify it under the terms of the GNU Lesser General Public 006: License as published by the Free Software Foundation; either 007: version 2.1 of the License, or (at your option) any later version. 008: 009: The GNU C Library is distributed in the hope that it will be useful, 010: but WITHOUT ANY WARRANTY; without even the implied warranty of 011: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012: Lesser General Public License for more details. 013: 014: You should have received a copy of the GNU Lesser General Public 015: License along with the GNU C Library; if not, write to the Free 016: Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 017: 02111-1307 USA. */ 018: 019: /* 020: * ISO C99: 7.3 Complex arithmetic <complex.h> 021: */ 022: 023: #ifndef _COMPLEX_H 024: #define _COMPLEX_H 1 025: 026: #include <features.h> 027: 028: /* Get general and ISO C99 specific information. */ 029: #include <bits/mathdef.h> 030: 031: __BEGIN_DECLS 032: 033: /* We might need to add support for more compilers here. But since ISO 034: C99 is out hopefully all maintained compilers will soon provide the data 035: types `float complex' and `double complex'. */ 036: #if __GNUC_PREREQ (2, 7) && !__GNUC_PREREQ (2, 97) 037: # define _Complex __complex__ 038: #endif 039: 040: #define complex _Complex 041: 042: /* Narrowest imaginary unit. This depends on the floating-point 043: evaluation method. 044: XXX This probably has to go into a gcc related file. */ 045: #define _Complex_I (__extension__ 1.0iF) 046: 047: /* Another more descriptive name is `I'. 048: XXX Once we have the imaginary support switch this to _Imaginary_I. */ 049: #undef I 050: #define I _Complex_I 051: 052: /* The file <bits/cmathcalls.h> contains the prototypes for all the 053: actual math functions. These macros are used for those prototypes, 054: so we can easily declare each function as both `name' and `__name', 055: and can declare the float versions `namef' and `__namef'. */ 056: 057: #define __MATHCALL(function, args) \ 058: __MATHDECL (_Mdouble_complex_,function, args) 059: #define __MATHDECL(type, function, args) \ 060: __MATHDECL_1(type, function, args); \ 061: __MATHDECL_1(type, __CONCAT(__,function), args) 062: #define __MATHDECL_1(type, function, args) \ 063: extern type __MATH_PRECNAME(function) args __THROW 064: 065: #define _Mdouble_ double 066: #define __MATH_PRECNAME(name) name 067: #include <bits/cmathcalls.h> 068: #undef _Mdouble_ 069: #undef __MATH_PRECNAME 070: 071: /* Now the float versions. */ 072: #ifndef _Mfloat_ 073: # define _Mfloat_ float 074: #endif 075: #define _Mdouble_ _Mfloat_ 076: #ifdef __STDC__ 077: # define __MATH_PRECNAME(name) name##f 078: #else 079: # define __MATH_PRECNAME(name) name/**/f 080: #endif 081: #include <bits/cmathcalls.h> 082: #undef _Mdouble_ 083: #undef __MATH_PRECNAME 084: 085: /* And the long double versions. It is non-critical to define them 086: here unconditionally since `long double' is required in ISO C99. */ 087: #if (__STDC__ - 0 || __GNUC__ - 0) \ 088: && (!(defined __NO_LONG_DOUBLE_MATH && defined _LIBC) \ 089: || defined __LDBL_COMPAT) 090: # if defined __LDBL_COMPAT || defined __NO_LONG_DOUBLE_MATH 091: # undef __MATHDECL_1 092: # define __MATHDECL_1(type, function, args) \ 093: extern type __REDIRECT_NTH(__MATH_PRECNAME(function), args, function) 094: # endif 095: 096: # ifndef _Mlong_double_ 097: # define _Mlong_double_ long double 098: # endif 099: # define _Mdouble_ _Mlong_double_ 100: # ifdef __STDC__ 101: # define __MATH_PRECNAME(name) name##l 102: # else 103: # define __MATH_PRECNAME(name) name/**/l 104: # endif 105: # include <bits/cmathcalls.h> 106: #endif 107: #undef _Mdouble_ 108: #undef __MATH_PRECNAME 109: #undef __MATHDECL_1 110: #undef __MATHDECL 111: #undef __MATHCALL 112: 113: __END_DECLS 114: 115: #endif /* complex.h */ 116: