1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * * Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * * Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in 12 * the documentation and/or other materials provided with the 13 * distribution. 14 * 15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 18 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 19 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 22 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 25 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29 #include <complex.h> 30 31 #include "header_checks.h" 32 33 #if !defined(complex) 34 #error complex 35 #endif 36 #if !defined(_Complex_I) 37 #error _Complex_I 38 #endif 39 40 #if 0 // No libc actually implements this. 41 #if !defined(imaginary) 42 #error imaginary 43 #endif 44 #if !defined(_Imaginary_I) 45 #error _Imaginary_I 46 #endif 47 #endif 48 49 #if !defined(I) 50 #error I 51 #endif 52 53 static void complex_h() { 54 FUNCTION(cabs, double (*f)(double complex)); 55 FUNCTION(cabsf, float (*f)(float complex)); 56 FUNCTION(cabsl, long double (*f)(long double complex)); 57 58 FUNCTION(cacos, double complex (*f)(double complex)); 59 FUNCTION(cacosf, float complex (*f)(float complex)); 60 FUNCTION(cacosl, long double complex (*f)(long double complex)); 61 62 FUNCTION(cacosh, double complex (*f)(double complex)); 63 FUNCTION(cacoshf, float complex (*f)(float complex)); 64 FUNCTION(cacoshl, long double complex (*f)(long double complex)); 65 66 FUNCTION(carg, double (*f)(double complex)); 67 FUNCTION(cargf, float (*f)(float complex)); 68 FUNCTION(cargl, long double (*f)(long double complex)); 69 70 FUNCTION(casin, double complex (*f)(double complex)); 71 FUNCTION(casinf, float complex (*f)(float complex)); 72 FUNCTION(casinl, long double complex (*f)(long double complex)); 73 74 FUNCTION(casinh, double complex (*f)(double complex)); 75 FUNCTION(casinhf, float complex (*f)(float complex)); 76 FUNCTION(casinhl, long double complex (*f)(long double complex)); 77 78 FUNCTION(catan, double complex (*f)(double complex)); 79 FUNCTION(catanf, float complex (*f)(float complex)); 80 FUNCTION(catanl, long double complex (*f)(long double complex)); 81 82 FUNCTION(catanh, double complex (*f)(double complex)); 83 FUNCTION(catanhf, float complex (*f)(float complex)); 84 FUNCTION(catanhl, long double complex (*f)(long double complex)); 85 86 FUNCTION(ccos, double complex (*f)(double complex)); 87 FUNCTION(ccosf, float complex (*f)(float complex)); 88 FUNCTION(ccosl, long double complex (*f)(long double complex)); 89 90 FUNCTION(ccosh, double complex (*f)(double complex)); 91 FUNCTION(ccoshf, float complex (*f)(float complex)); 92 FUNCTION(ccoshl, long double complex (*f)(long double complex)); 93 94 FUNCTION(cexp, double complex (*f)(double complex)); 95 FUNCTION(cexpf, float complex (*f)(float complex)); 96 FUNCTION(cexpl, long double complex (*f)(long double complex)); 97 98 FUNCTION(cimag, double (*f)(double complex)); 99 FUNCTION(cimagf, float (*f)(float complex)); 100 FUNCTION(cimagl, long double (*f)(long double complex)); 101 102 FUNCTION(clog, double complex (*f)(double complex)); 103 FUNCTION(clogf, float complex (*f)(float complex)); 104 FUNCTION(clogl, long double complex (*f)(long double complex)); 105 106 FUNCTION(conj, double complex (*f)(double complex)); 107 FUNCTION(conjf, float complex (*f)(float complex)); 108 FUNCTION(conjl, long double complex (*f)(long double complex)); 109 110 FUNCTION(cpow, double complex (*f)(double complex, double complex)); 111 FUNCTION(cpowf, float complex (*f)(float complex, float complex)); 112 FUNCTION(cpowl, long double complex (*f)(long double complex, long double complex)); 113 114 FUNCTION(cproj, double complex (*f)(double complex)); 115 FUNCTION(cprojf, float complex (*f)(float complex)); 116 FUNCTION(cprojl, long double complex (*f)(long double complex)); 117 118 FUNCTION(creal, double (*f)(double complex)); 119 FUNCTION(crealf, float (*f)(float complex)); 120 FUNCTION(creall, long double (*f)(long double complex)); 121 122 FUNCTION(csin, double complex (*f)(double complex)); 123 FUNCTION(csinf, float complex (*f)(float complex)); 124 FUNCTION(csinl, long double complex (*f)(long double complex)); 125 126 FUNCTION(csinh, double complex (*f)(double complex)); 127 FUNCTION(csinhf, float complex (*f)(float complex)); 128 FUNCTION(csinhl, long double complex (*f)(long double complex)); 129 130 FUNCTION(csqrt, double complex (*f)(double complex)); 131 FUNCTION(csqrtf, float complex (*f)(float complex)); 132 FUNCTION(csqrtl, long double complex (*f)(long double complex)); 133 134 FUNCTION(ctan, double complex (*f)(double complex)); 135 FUNCTION(ctanf, float complex (*f)(float complex)); 136 FUNCTION(ctanl, long double complex (*f)(long double complex)); 137 138 FUNCTION(ctanh, double complex (*f)(double complex)); 139 FUNCTION(ctanhf, float complex (*f)(float complex)); 140 FUNCTION(ctanhl, long double complex (*f)(long double complex)); 141 } 142