Never include <complex.h>. Include <openlibm_complex.h> instead.

If we ship with a separate copy of <complex.h>, we should also use this
one instead of the one provided by the system.
This commit is contained in:
Ed Schouten 2015-01-09 13:30:44 +01:00
parent beb387c4b2
commit 08dbb2b517
74 changed files with 147 additions and 127 deletions

View File

@ -27,9 +27,9 @@
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/k_exp.c,v 1.1 2011/10/21 06:27:56 das Exp $");
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "openlibm.h"
#include "math_private.h"
static const u_int32_t k = 1799; /* constant for reduction */

View File

@ -27,9 +27,9 @@
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/k_expf.c,v 1.1 2011/10/21 06:27:56 das Exp $");
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "openlibm.h"
#include "math_private.h"
static const u_int32_t k = 235; /* constant for reduction */

View File

@ -17,10 +17,11 @@
#ifndef _MATH_PRIVATE_H_
#define _MATH_PRIVATE_H_
#include <openlibm_complex.h>
#include "cdefs-compat.h"
#include "types-compat.h"
#include "fpmath.h"
#include <complex.h>
#include <stdint.h>
#include "math_private_openbsd.h"

View File

@ -14,10 +14,10 @@
* $FreeBSD: src/lib/msun/src/openlibm.h,v 1.82 2011/11/12 19:55:48 theraven Exp $
*/
#ifndef _MATH_H_
#define _MATH_H_
#ifndef OPENLIBM_H
#define OPENLIBM_H
#include <complex.h>
#include <openlibm_complex.h>
#if (defined(_WIN32) || defined (_MSC_VER)) && !defined(__WIN32__)
#define __WIN32__
@ -581,9 +581,7 @@ long double truncl(long double);
long double lgammal_r(long double, int *);
#endif /* __BSD_VISIBLE */
#include "openlibm_complex.h"
#if defined(__cplusplus)
}
#endif
#endif /* !_MATH_H_ */
#endif /* !OPENLIBM_H */

View File

@ -15,10 +15,13 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _OPENLIBM_COMPLEX_H_
#define _OPENLIBM_COMPLEX_H_
#ifndef OPENLIBM_COMPLEX_H
#define OPENLIBM_COMPLEX_H
#include <sys/cdefs.h>
#define complex _Complex
#define _Complex_I 1.0fi
#define I _Complex_I
/*
* Double versions of C99 functions
@ -99,4 +102,4 @@ long double complex conjl(long double complex);
long double complex cprojl(long double complex);
long double creall(long double complex);
#endif /* !_OPENLIBM_COMPLEX_H_ */
#endif /* !OPENLIBM_COMPLEX_H */

View File

@ -15,9 +15,9 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <complex.h>
#include <float.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
double
cabs(double complex z)

View File

@ -15,8 +15,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
float
cabsf(float complex z)

View File

@ -16,8 +16,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
long double
cabsl(long double complex z)

View File

@ -46,9 +46,9 @@
* IEEE -10,+10 30000 1.8e-14 2.2e-15
*/
#include <complex.h>
#include <float.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
double complex
cacos(double complex z)

View File

@ -46,8 +46,8 @@
*
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
float complex
cacosf(float complex z)

View File

@ -42,9 +42,9 @@
*
*/
#include <complex.h>
#include <float.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
double complex
cacosh(double complex z)

View File

@ -42,8 +42,8 @@
*
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
float complex
cacoshf(float complex z)

View File

@ -43,8 +43,8 @@
*
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
long double complex
cacoshl(long double complex z)

View File

@ -47,8 +47,8 @@
* IEEE -10,+10 30000 1.8e-14 2.2e-15
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
static const long double PIO2L = 1.570796326794896619231321691639751442098585L;

View File

@ -27,8 +27,9 @@
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/s_carg.c,v 1.1 2007/12/12 23:43:51 das Exp $");
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"
DLLEXPORT double

View File

@ -27,8 +27,9 @@
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/s_cargf.c,v 1.1 2007/12/12 23:43:51 das Exp $");
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"
DLLEXPORT float

View File

@ -27,8 +27,9 @@
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/s_cargl.c,v 1.1 2008/07/31 22:41:26 das Exp $");
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"
DLLEXPORT long double

View File

@ -49,9 +49,9 @@
* Also tested by csin(casin(z)) = z.
*/
#include <complex.h>
#include <float.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
double complex
casin(double complex z)

View File

@ -47,8 +47,8 @@
*
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
float complex
casinf(float complex z)

View File

@ -42,9 +42,9 @@
*
*/
#include <complex.h>
#include <float.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
double complex
casinh(double complex z)

View File

@ -42,8 +42,8 @@
*
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
float complex
casinhf(float complex z)

View File

@ -43,8 +43,8 @@
*
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
long double complex
casinhl(long double complex z)

View File

@ -49,9 +49,9 @@
* Also tested by csin(casin(z)) = z.
*/
#include <complex.h>
#include <float.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
#if LDBL_MANT_DIG == 64
static const long double MACHEPL= 5.42101086242752217003726400434970855712890625E-20L;

View File

@ -62,9 +62,9 @@
* 2.9e-17. See also clog().
*/
#include <complex.h>
#include <float.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
#define MAXNUM 1.0e308

View File

@ -59,8 +59,8 @@
*
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
#define MAXNUMF 1.0e38F

View File

@ -42,9 +42,9 @@
*
*/
#include <complex.h>
#include <float.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
double complex
catanh(double complex z)

View File

@ -42,8 +42,8 @@
*
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
float complex
catanhf(float complex z)

View File

@ -43,8 +43,8 @@
*
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
long double complex
catanhl(long double complex z)

View File

@ -63,9 +63,9 @@
* 2.9e-17. See also clog().
*/
#include <complex.h>
#include <float.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
static const long double PIL = 3.141592653589793238462643383279502884197169L;
static const long double DP1 = 3.14159265358979323829596852490908531763125L;

View File

@ -49,9 +49,9 @@
* IEEE -10,+10 30000 3.8e-16 1.0e-16
*/
#include <complex.h>
#include <float.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
/* calculate cosh and sinh */

View File

@ -48,8 +48,8 @@
* IEEE -10,+10 30000 1.8e-7 5.5e-8
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
/* calculate cosh and sinh */

View File

@ -37,8 +37,8 @@
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/s_ccosh.c,v 1.2 2011/10/21 06:29:32 das Exp $");
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"

View File

@ -31,8 +31,8 @@
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/s_ccoshf.c,v 1.2 2011/10/21 06:29:32 das Exp $");
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"

View File

@ -43,8 +43,8 @@
*
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
long double complex
ccoshl(long double complex z)

View File

@ -50,8 +50,8 @@
* IEEE -10,+10 30000 3.8e-16 1.0e-16
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
static void
cchshl(long double x, long double *c, long double *s)

View File

@ -27,8 +27,8 @@
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/s_cexp.c,v 1.3 2011/10/21 06:27:56 das Exp $");
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"

View File

@ -27,8 +27,8 @@
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/s_cexpf.c,v 1.3 2011/10/21 06:27:56 das Exp $");
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"

View File

@ -54,8 +54,8 @@
*
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
long double complex
cexpl(long double complex z)

View File

@ -26,8 +26,9 @@
* $FreeBSD: src/lib/msun/src/s_cimag.c,v 1.3 2009/03/14 18:24:15 das Exp $
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"
DLLEXPORT double

View File

@ -26,8 +26,9 @@
* $FreeBSD: src/lib/msun/src/s_cimagf.c,v 1.3 2009/03/14 18:24:15 das Exp $
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"
DLLEXPORT float

View File

@ -26,8 +26,9 @@
* $FreeBSD: src/lib/msun/src/s_cimagl.c,v 1.3 2009/03/14 18:24:15 das Exp $
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"
DLLEXPORT long double

View File

@ -54,9 +54,9 @@
* absolute error 1.0e-16.
*/
#include <complex.h>
#include <float.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
double complex
clog(double complex z)

View File

@ -53,8 +53,8 @@
*
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
float complex
clogf(float complex z)

View File

@ -55,8 +55,8 @@
* absolute error 1.0e-16.
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
long double complex
clogl(long double complex z)

View File

@ -26,9 +26,9 @@
* $FreeBSD: src/lib/msun/src/s_conj.c,v 1.2 2008/08/07 14:39:56 das Exp $
*/
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "openlibm.h"
#include "math_private.h"
DLLEXPORT double complex

View File

@ -26,9 +26,9 @@
* $FreeBSD: src/lib/msun/src/s_conjf.c,v 1.2 2008/08/07 14:39:56 das Exp $
*/
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "openlibm.h"
#include "math_private.h"
DLLEXPORT float complex

View File

@ -26,9 +26,9 @@
* $FreeBSD: src/lib/msun/src/s_conjl.c,v 1.2 2008/08/07 14:39:56 das Exp $
*/
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "openlibm.h"
#include "math_private.h"
DLLEXPORT long double complex

View File

@ -44,9 +44,10 @@
*
*/
#include <complex.h>
#include <float.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"
DLLEXPORT double complex

View File

@ -44,8 +44,9 @@
*
*/
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"
DLLEXPORT float complex

View File

@ -45,8 +45,9 @@
*
*/
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"
DLLEXPORT long double complex

View File

@ -27,8 +27,8 @@
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/s_cproj.c,v 1.1 2008/08/07 15:07:48 das Exp $");
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"

View File

@ -27,8 +27,8 @@
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/s_cprojf.c,v 1.1 2008/08/07 15:07:48 das Exp $");
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"

View File

@ -27,8 +27,8 @@
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/s_cprojl.c,v 1.1 2008/08/07 15:07:48 das Exp $");
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"

View File

@ -26,7 +26,9 @@
* $FreeBSD: src/lib/msun/src/s_creal.c,v 1.1 2004/05/30 09:21:56 stefanf Exp $
*/
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"
DLLEXPORT double

View File

@ -26,7 +26,9 @@
* $FreeBSD: src/lib/msun/src/s_crealf.c,v 1.1 2004/05/30 09:21:56 stefanf Exp $
*/
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"
DLLEXPORT float

View File

@ -26,7 +26,9 @@
* $FreeBSD: src/lib/msun/src/s_creall.c,v 1.1 2004/05/30 09:21:56 stefanf Exp $
*/
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"
DLLEXPORT long double

View File

@ -51,9 +51,9 @@
*
*/
#include <complex.h>
#include <float.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
/* calculate cosh and sinh */

View File

@ -49,8 +49,8 @@
*
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
/* calculate cosh and sinh */

View File

@ -37,8 +37,8 @@
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/s_csinh.c,v 1.2 2011/10/21 06:29:32 das Exp $");
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"

View File

@ -31,8 +31,8 @@
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/s_csinhf.c,v 1.2 2011/10/21 06:29:32 das Exp $");
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"

View File

@ -42,8 +42,8 @@
*
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
long double complex
csinhl(long double complex z)

View File

@ -52,8 +52,8 @@
*
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
static void
cchshl(long double x, long double *c, long double *s)

View File

@ -27,9 +27,9 @@
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/s_csqrt.c,v 1.4 2008/08/08 00:15:16 das Exp $");
#include <complex.h>
#include <float.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"

View File

@ -27,8 +27,8 @@
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/s_csqrtf.c,v 1.3 2008/08/08 00:15:16 das Exp $");
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"

View File

@ -26,9 +26,9 @@
#include "cdefs-compat.h"
#include <complex.h>
#include <float.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"

View File

@ -56,9 +56,9 @@
* Also tested by ctan * ccot = 1 and catan(ctan(z)) = z.
*/
#include <complex.h>
#include <float.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
#define MACHEP 1.1e-16
#define MAXNUM 1.0e308

View File

@ -53,8 +53,8 @@
* IEEE -10,+10 30000 3.3e-7 5.1e-8
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
#define MACHEPF 3.0e-8
#define MAXNUMF 1.0e38f

View File

@ -66,8 +66,8 @@
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/s_ctanh.c,v 1.2 2011/10/21 06:30:16 das Exp $");
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"

View File

@ -31,8 +31,8 @@
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/s_ctanhf.c,v 1.2 2011/10/21 06:30:16 das Exp $");
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"

View File

@ -43,8 +43,8 @@
*
*/
#include <complex.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
long double complex
ctanhl(long double complex z)

View File

@ -56,9 +56,9 @@
* Also tested by ctan * ccot = 1 and catan(ctan(z)) = z.
*/
#include <complex.h>
#include <float.h>
#include "openlibm.h"
#include <openlibm.h>
#include <openlibm_complex.h>
#if LDBL_MANT_DIG == 64
static const long double MACHEPL= 5.42101086242752217003726400434970855712890625E-20L;

View File

@ -8,9 +8,10 @@
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/w_cabs.c,v 1.7 2008/03/30 20:03:06 das Exp $");
#include <complex.h>
#include <float.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"
DLLEXPORT double

View File

@ -5,8 +5,9 @@
* Placed into the Public Domain, 1994.
*/
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"
DLLEXPORT float

View File

@ -10,8 +10,9 @@
#include "cdefs-compat.h"
//__FBSDID("$FreeBSD: src/lib/msun/src/w_cabsl.c,v 1.1 2008/03/30 20:02:03 das Exp $");
#include <complex.h>
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"
DLLEXPORT long double