125c28e8Piotr Jasiukajtis/*
225c28e8Piotr Jasiukajtis * CDDL HEADER START
325c28e8Piotr Jasiukajtis *
425c28e8Piotr Jasiukajtis * The contents of this file are subject to the terms of the
525c28e8Piotr Jasiukajtis * Common Development and Distribution License (the "License").
625c28e8Piotr Jasiukajtis * You may not use this file except in compliance with the License.
725c28e8Piotr Jasiukajtis *
825c28e8Piotr Jasiukajtis * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
925c28e8Piotr Jasiukajtis * or http://www.opensolaris.org/os/licensing.
1025c28e8Piotr Jasiukajtis * See the License for the specific language governing permissions
1125c28e8Piotr Jasiukajtis * and limitations under the License.
1225c28e8Piotr Jasiukajtis *
1325c28e8Piotr Jasiukajtis * When distributing Covered Code, include this CDDL HEADER in each
1425c28e8Piotr Jasiukajtis * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1525c28e8Piotr Jasiukajtis * If applicable, add the following below this CDDL HEADER, with the
1625c28e8Piotr Jasiukajtis * fields enclosed by brackets "[]" replaced with your own identifying
1725c28e8Piotr Jasiukajtis * information: Portions Copyright [yyyy] [name of copyright owner]
1825c28e8Piotr Jasiukajtis *
1925c28e8Piotr Jasiukajtis * CDDL HEADER END
2025c28e8Piotr Jasiukajtis */
2125c28e8Piotr Jasiukajtis/*
2225c28e8Piotr Jasiukajtis * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
2325c28e8Piotr Jasiukajtis */
2425c28e8Piotr Jasiukajtis/*
2525c28e8Piotr Jasiukajtis * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
2625c28e8Piotr Jasiukajtis * Use is subject to license terms.
2725c28e8Piotr Jasiukajtis */
2825c28e8Piotr Jasiukajtis
2925c28e8Piotr Jasiukajtis#ifndef _TGMATH_H
3025c28e8Piotr Jasiukajtis#define	_TGMATH_H
3125c28e8Piotr Jasiukajtis
3225c28e8Piotr Jasiukajtis#if !defined(__cplusplus)
3325c28e8Piotr Jasiukajtis
3425c28e8Piotr Jasiukajtis#include <math.h>
3525c28e8Piotr Jasiukajtis#include <complex.h>
3625c28e8Piotr Jasiukajtis
3725c28e8Piotr Jasiukajtis/*
3825c28e8Piotr Jasiukajtis * real-floating and complex
3925c28e8Piotr Jasiukajtis */
4025c28e8Piotr Jasiukajtis#undef	acos
4125c28e8Piotr Jasiukajtis#define	acos(x)			__tgmath_acos(x)
4225c28e8Piotr Jasiukajtis#undef	asin
4325c28e8Piotr Jasiukajtis#define	asin(x)			__tgmath_asin(x)
4425c28e8Piotr Jasiukajtis#undef	atan
4525c28e8Piotr Jasiukajtis#define	atan(x)			__tgmath_atan(x)
4625c28e8Piotr Jasiukajtis#undef	acosh
4725c28e8Piotr Jasiukajtis#define	acosh(x)		__tgmath_acosh(x)
4825c28e8Piotr Jasiukajtis#undef	asinh
4925c28e8Piotr Jasiukajtis#define	asinh(x)		__tgmath_asinh(x)
5025c28e8Piotr Jasiukajtis#undef	atanh
5125c28e8Piotr Jasiukajtis#define	atanh(x)		__tgmath_atanh(x)
5225c28e8Piotr Jasiukajtis#undef	cos
5325c28e8Piotr Jasiukajtis#define	cos(x)			__tgmath_cos(x)
5425c28e8Piotr Jasiukajtis#undef	sin
5525c28e8Piotr Jasiukajtis#define	sin(x)			__tgmath_sin(x)
5625c28e8Piotr Jasiukajtis#undef	tan
5725c28e8Piotr Jasiukajtis#define	tan(x)			__tgmath_tan(x)
5825c28e8Piotr Jasiukajtis#undef	cosh
5925c28e8Piotr Jasiukajtis#define	cosh(x)			__tgmath_cosh(x)
6025c28e8Piotr Jasiukajtis#undef	sinh
6125c28e8Piotr Jasiukajtis#define	sinh(x)			__tgmath_sinh(x)
6225c28e8Piotr Jasiukajtis#undef	tanh
6325c28e8Piotr Jasiukajtis#define	tanh(x)			__tgmath_tanh(x)
6425c28e8Piotr Jasiukajtis#undef	exp
6525c28e8Piotr Jasiukajtis#define	exp(x)			__tgmath_exp(x)
6625c28e8Piotr Jasiukajtis#undef	log
6725c28e8Piotr Jasiukajtis#define	log(x)			__tgmath_log(x)
6825c28e8Piotr Jasiukajtis#undef	pow
6925c28e8Piotr Jasiukajtis#define	pow(x, y)		__tgmath_pow(x, y)
7025c28e8Piotr Jasiukajtis#undef	sqrt
7125c28e8Piotr Jasiukajtis#define	sqrt(x)			__tgmath_sqrt(x)
7225c28e8Piotr Jasiukajtis#undef	fabs
7325c28e8Piotr Jasiukajtis#define	fabs(x)			__tgmath_fabs(x)
7425c28e8Piotr Jasiukajtis
7525c28e8Piotr Jasiukajtis/*
7625c28e8Piotr Jasiukajtis * real-floating only
7725c28e8Piotr Jasiukajtis */
7825c28e8Piotr Jasiukajtis#undef	atan2
7925c28e8Piotr Jasiukajtis#define	atan2(y, x)		__tgmath_atan2(y, x)
8025c28e8Piotr Jasiukajtis#undef	cbrt
8125c28e8Piotr Jasiukajtis#define	cbrt(x)			__tgmath_cbrt(x)
8225c28e8Piotr Jasiukajtis#undef	ceil
8325c28e8Piotr Jasiukajtis#define	ceil(x)			__tgmath_ceil(x)
8425c28e8Piotr Jasiukajtis#undef	copysign
8525c28e8Piotr Jasiukajtis#define	copysign(x, y)		__tgmath_copysign(x, y)
8625c28e8Piotr Jasiukajtis#undef	erf
8725c28e8Piotr Jasiukajtis#define	erf(x)			__tgmath_erf(x)
8825c28e8Piotr Jasiukajtis#undef	erfc
8925c28e8Piotr Jasiukajtis#define	erfc(x)			__tgmath_erfc(x)
9025c28e8Piotr Jasiukajtis#undef	exp2
9125c28e8Piotr Jasiukajtis#define	exp2(x)			__tgmath_exp2(x)
9225c28e8Piotr Jasiukajtis#undef	expm1
9325c28e8Piotr Jasiukajtis#define	expm1(x)		__tgmath_expm1(x)
9425c28e8Piotr Jasiukajtis#undef	fdim
9525c28e8Piotr Jasiukajtis#define	fdim(x, y)		__tgmath_fdim(x, y)
9625c28e8Piotr Jasiukajtis#undef	floor
9725c28e8Piotr Jasiukajtis#define	floor(x)		__tgmath_floor(x)
9825c28e8Piotr Jasiukajtis#undef	fma
9925c28e8Piotr Jasiukajtis#define	fma(x, y, z)		__tgmath_fma(x, y, z)
10025c28e8Piotr Jasiukajtis#undef	fmax
10125c28e8Piotr Jasiukajtis#define	fmax(x, y)		__tgmath_fmax(x, y)
10225c28e8Piotr Jasiukajtis#undef	fmin
10325c28e8Piotr Jasiukajtis#define	fmin(x, y)		__tgmath_fmin(x, y)
10425c28e8Piotr Jasiukajtis#undef	fmod
10525c28e8Piotr Jasiukajtis#define	fmod(x, y)		__tgmath_fmod(x, y)
10625c28e8Piotr Jasiukajtis#undef	frexp
10725c28e8Piotr Jasiukajtis#define	frexp(x, ip)		__tgmath_frexp(x, ip)
10825c28e8Piotr Jasiukajtis#undef	hypot
10925c28e8Piotr Jasiukajtis#define	hypot(x, y)		__tgmath_hypot(x, y)
11025c28e8Piotr Jasiukajtis#undef	ilogb
11125c28e8Piotr Jasiukajtis#define	ilogb(x)		__tgmath_ilogb(x)
11225c28e8Piotr Jasiukajtis#undef	ldexp
11325c28e8Piotr Jasiukajtis#define	ldexp(x, i)		__tgmath_ldexp(x, i)
11425c28e8Piotr Jasiukajtis#undef	lgamma
11525c28e8Piotr Jasiukajtis#define	lgamma(x)		__tgmath_lgamma(x)
11625c28e8Piotr Jasiukajtis#undef	llrint
11725c28e8Piotr Jasiukajtis#define	llrint(x)		__tgmath_llrint(x)
11825c28e8Piotr Jasiukajtis#undef	llround
11925c28e8Piotr Jasiukajtis#define	llround(x)		__tgmath_llround(x)
12025c28e8Piotr Jasiukajtis#undef	log10
12125c28e8Piotr Jasiukajtis#define	log10(x)		__tgmath_log10(x)
12225c28e8Piotr Jasiukajtis#undef	log1p
12325c28e8Piotr Jasiukajtis#define	log1p(x)		__tgmath_log1p(x)
12425c28e8Piotr Jasiukajtis#undef	log2
12525c28e8Piotr Jasiukajtis#define	log2(x)			__tgmath_log2(x)
12625c28e8Piotr Jasiukajtis#undef	logb
12725c28e8Piotr Jasiukajtis#define	logb(x)			__tgmath_logb(x)
12825c28e8Piotr Jasiukajtis#undef	lrint
12925c28e8Piotr Jasiukajtis#define	lrint(x)		__tgmath_lrint(x)
13025c28e8Piotr Jasiukajtis#undef	lround
13125c28e8Piotr Jasiukajtis#define	lround(x)		__tgmath_lround(x)
13225c28e8Piotr Jasiukajtis#undef	nearbyint
13325c28e8Piotr Jasiukajtis#define	nearbyint(x)		__tgmath_nearbyint(x)
13425c28e8Piotr Jasiukajtis#undef	nextafter
13525c28e8Piotr Jasiukajtis#define	nextafter(x, y)		__tgmath_nextafter(x, y)
13625c28e8Piotr Jasiukajtis#undef	nexttoward
13725c28e8Piotr Jasiukajtis#define	nexttoward(x, y)	__tgmath_nexttoward(x, y)
13825c28e8Piotr Jasiukajtis#undef	remainder
13925c28e8Piotr Jasiukajtis#define	remainder(x, y)		__tgmath_remainder(x, y)
14025c28e8Piotr Jasiukajtis#undef	remquo
14125c28e8Piotr Jasiukajtis#define	remquo(x, y, ip)	__tgmath_remquo(x, y, ip)
14225c28e8Piotr Jasiukajtis#undef	rint
14325c28e8Piotr Jasiukajtis#define	rint(x)			__tgmath_rint(x)
14425c28e8Piotr Jasiukajtis#undef	round
14525c28e8Piotr Jasiukajtis#define	round(x)		__tgmath_round(x)
14625c28e8Piotr Jasiukajtis#undef	scalbln
14725c28e8Piotr Jasiukajtis#define	scalbln(x, l)		__tgmath_scalbln(x, l)
14825c28e8Piotr Jasiukajtis#undef	scalbn
14925c28e8Piotr Jasiukajtis#define	scalbn(x, i)		__tgmath_scalbn(x, i)
15025c28e8Piotr Jasiukajtis#undef	tgamma
15125c28e8Piotr Jasiukajtis#define	tgamma(x)		__tgmath_tgamma(x)
15225c28e8Piotr Jasiukajtis#undef	trunc
15325c28e8Piotr Jasiukajtis#define	trunc(x)		__tgmath_trunc(x)
15425c28e8Piotr Jasiukajtis
15525c28e8Piotr Jasiukajtis/*
15625c28e8Piotr Jasiukajtis * complex only
15725c28e8Piotr Jasiukajtis */
15825c28e8Piotr Jasiukajtis#undef	carg
15925c28e8Piotr Jasiukajtis#define	carg(x)			__tgmath_carg(x)
16025c28e8Piotr Jasiukajtis#undef	cimag
16125c28e8Piotr Jasiukajtis#define	cimag(x)		__tgmath_cimag(x)
16225c28e8Piotr Jasiukajtis#undef	conj
16325c28e8Piotr Jasiukajtis#define	conj(x)			__tgmath_conj(x)
16425c28e8Piotr Jasiukajtis#undef	cproj
16525c28e8Piotr Jasiukajtis#define	cproj(x)		__tgmath_cproj(x)
16625c28e8Piotr Jasiukajtis#undef	creal
16725c28e8Piotr Jasiukajtis#define	creal(x)		__tgmath_creal(x)
16825c28e8Piotr Jasiukajtis
16925c28e8Piotr Jasiukajtis#endif	/* !defined(__cplusplus) */
17025c28e8Piotr Jasiukajtis
17125c28e8Piotr Jasiukajtis#endif	/* _TGMATH_H */
172