diff --git a/src/Make.files b/src/Make.files index d363bfe..04abe4d 100644 --- a/src/Make.files +++ b/src/Make.files @@ -1,4 +1,4 @@ -$(CUR_SRCS) = \ +$(CUR_SRCS) = common.c \ e_acos.c e_acosf.c e_acosh.c e_acoshf.c e_asin.c e_asinf.c \ e_atan2.c e_atan2f.c e_atanh.c e_atanhf.c e_cosh.c e_coshf.c e_exp.c \ e_expf.c e_fmod.c e_fmodf.c e_gamma.c e_gamma_r.c e_gammaf.c \ diff --git a/src/common.c b/src/common.c new file mode 100644 index 0000000..ce86102 --- /dev/null +++ b/src/common.c @@ -0,0 +1,4 @@ +#include "math_private.h" +DLLEXPORT int isopenlibm() { + return 1; +} diff --git a/src/e_acos.c b/src/e_acos.c index 810f5e9..3eea520 100644 --- a/src/e_acos.c +++ b/src/e_acos.c @@ -61,7 +61,7 @@ qS2 = 2.02094576023350569471e+00, /* 0x40002AE5, 0x9C598AC8 */ qS3 = -6.88283971605453293030e-01, /* 0xBFE6066C, 0x1B8D0159 */ qS4 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */ -double +DLLEXPORT double __ieee754_acos(double x) { double z,p,q,r,w,s,c,df; diff --git a/src/e_acosf.c b/src/e_acosf.c index bfce86b..8e32fae 100644 --- a/src/e_acosf.c +++ b/src/e_acosf.c @@ -31,7 +31,7 @@ pS1 = -4.2743422091e-02, pS2 = -8.6563630030e-03, qS1 = -7.0662963390e-01; -float +DLLEXPORT float __ieee754_acosf(float x) { float z,p,q,r,w,s,c,df; diff --git a/src/e_acosh.c b/src/e_acosh.c index 3a05602..6180b24 100644 --- a/src/e_acosh.c +++ b/src/e_acosh.c @@ -36,7 +36,7 @@ static const double one = 1.0, ln2 = 6.93147180559945286227e-01; /* 0x3FE62E42, 0xFEFA39EF */ -double +DLLEXPORT double __ieee754_acosh(double x) { double t; diff --git a/src/e_acoshf.c b/src/e_acoshf.c index 753d7ce..65de3f2 100644 --- a/src/e_acoshf.c +++ b/src/e_acoshf.c @@ -23,7 +23,7 @@ static const float one = 1.0, ln2 = 6.9314718246e-01; /* 0x3f317218 */ -float +DLLEXPORT float __ieee754_acoshf(float x) { float t; diff --git a/src/e_acosl.c b/src/e_acosl.c index 015e37b..fe6270f 100644 --- a/src/e_acosl.c +++ b/src/e_acosl.c @@ -40,7 +40,7 @@ static const long double pi = 3.14159265358979323846264338327950280e+00L; #endif -long double +DLLEXPORT long double acosl(long double x) { union IEEEl2bits u; diff --git a/src/e_asin.c b/src/e_asin.c index 3b01a19..a0e76f5 100644 --- a/src/e_asin.c +++ b/src/e_asin.c @@ -67,7 +67,7 @@ qS2 = 2.02094576023350569471e+00, /* 0x40002AE5, 0x9C598AC8 */ qS3 = -6.88283971605453293030e-01, /* 0xBFE6066C, 0x1B8D0159 */ qS4 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */ -double +DLLEXPORT double __ieee754_asin(double x) { double t=0.0,w,p,q,c,r,s; diff --git a/src/e_asinf.c b/src/e_asinf.c index 679ce98..4db4550 100644 --- a/src/e_asinf.c +++ b/src/e_asinf.c @@ -31,7 +31,7 @@ qS1 = -7.0662963390e-01; static const double pio2 = 1.570796326794896558e+00; -float +DLLEXPORT float __ieee754_asinf(float x) { double s; diff --git a/src/e_asinl.c b/src/e_asinl.c index 2deef4b..6de8f0a 100644 --- a/src/e_asinl.c +++ b/src/e_asinl.c @@ -30,7 +30,7 @@ static const long double one = 1.00000000000000000000e+00, huge = 1.000e+300; -long double +DLLEXPORT long double asinl(long double x) { union IEEEl2bits u; diff --git a/src/e_atan2.c b/src/e_atan2.c index 6a2a453..d676c7e 100644 --- a/src/e_atan2.c +++ b/src/e_atan2.c @@ -57,7 +57,7 @@ pi = 3.1415926535897931160E+00; /* 0x400921FB, 0x54442D18 */ static volatile double pi_lo = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */ -double +DLLEXPORT double __ieee754_atan2(double y, double x) { double z; diff --git a/src/e_atan2f.c b/src/e_atan2f.c index 749b7ef..2dfc31f 100644 --- a/src/e_atan2f.c +++ b/src/e_atan2f.c @@ -29,7 +29,7 @@ pi = 3.1415927410e+00; /* 0x40490fdb */ static volatile float pi_lo = -8.7422776573e-08; /* 0xb3bbbd2e */ -float +DLLEXPORT float __ieee754_atan2f(float y, float x) { float z; diff --git a/src/e_atan2l.c b/src/e_atan2l.c index 0baac0e..3bad12f 100644 --- a/src/e_atan2l.c +++ b/src/e_atan2l.c @@ -43,7 +43,7 @@ static const long double pi = 3.14159265358979323846264338327950280e+00L; #endif -long double +DLLEXPORT long double atan2l(long double y, long double x) { union IEEEl2bits ux, uy; diff --git a/src/e_atanh.c b/src/e_atanh.c index eb2d1ed..d09ba50 100644 --- a/src/e_atanh.c +++ b/src/e_atanh.c @@ -39,7 +39,7 @@ static const double one = 1.0, huge = 1e300; static const double zero = 0.0; -double +DLLEXPORT double __ieee754_atanh(double x) { double t; diff --git a/src/e_atanhf.c b/src/e_atanhf.c index 4f33cf5..e69bf48 100644 --- a/src/e_atanhf.c +++ b/src/e_atanhf.c @@ -23,7 +23,7 @@ static const float one = 1.0, huge = 1e30; static const float zero = 0.0; -float +DLLEXPORT float __ieee754_atanhf(float x) { float t; diff --git a/src/e_cosh.c b/src/e_cosh.c index dd495b4..a8a5c6c 100644 --- a/src/e_cosh.c +++ b/src/e_cosh.c @@ -40,7 +40,7 @@ static const double one = 1.0, half=0.5, huge = 1.0e300; -double +DLLEXPORT double __ieee754_cosh(double x) { double t,w; diff --git a/src/e_coshf.c b/src/e_coshf.c index 1b34509..f5e8202 100644 --- a/src/e_coshf.c +++ b/src/e_coshf.c @@ -21,7 +21,7 @@ static const float one = 1.0, half=0.5, huge = 1.0e30; -float +DLLEXPORT float __ieee754_coshf(float x) { float t,w; diff --git a/src/e_exp.c b/src/e_exp.c index 1097c44..2ad215e 100644 --- a/src/e_exp.c +++ b/src/e_exp.c @@ -101,7 +101,7 @@ P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */ static volatile double twom1000= 9.33263618503218878990e-302; /* 2**-1000=0x01700000,0*/ -double +DLLEXPORT double __ieee754_exp(double x) /* default IEEE double exp */ { double y,hi=0.0,lo=0.0,c,t,twopk; diff --git a/src/e_expf.c b/src/e_expf.c index ca1629c..15d622b 100644 --- a/src/e_expf.c +++ b/src/e_expf.c @@ -41,7 +41,7 @@ P2 = -2.7667332906e-3; /* -0xb55215.0p-32 */ static volatile float twom100 = 7.8886090522e-31; /* 2**-100=0x0d800000 */ -float +DLLEXPORT float __ieee754_expf(float x) { float y,hi=0.0,lo=0.0,c,t,twopk; diff --git a/src/e_fmod.c b/src/e_fmod.c index 5633776..83076fb 100644 --- a/src/e_fmod.c +++ b/src/e_fmod.c @@ -25,7 +25,7 @@ static const double one = 1.0, Zero[] = {0.0, -0.0,}; -double +DLLEXPORT double __ieee754_fmod(double x, double y) { int32_t n,hx,hy,hz,ix,iy,sx,i; diff --git a/src/e_fmodf.c b/src/e_fmodf.c index aed7852..14ee260 100644 --- a/src/e_fmodf.c +++ b/src/e_fmodf.c @@ -27,7 +27,7 @@ static const float one = 1.0, Zero[] = {0.0, -0.0,}; -float +DLLEXPORT float __ieee754_fmodf(float x, float y) { int32_t n,hx,hy,hz,ix,iy,sx,i; diff --git a/src/e_fmodl.c b/src/e_fmodl.c index 8f4c5b2..452d155 100644 --- a/src/e_fmodl.c +++ b/src/e_fmodl.c @@ -61,7 +61,7 @@ static const long double one = 1.0, Zero[] = {0.0, -0.0,}; * - The high part of the mantissa fits in an int64_t with enough room * for an explicit integer bit in front of the fractional bits. */ -long double +DLLEXPORT long double fmodl(long double x, long double y) { union IEEEl2bits ux, uy; diff --git a/src/e_gamma.c b/src/e_gamma.c index 26cb25e..f256a15 100644 --- a/src/e_gamma.c +++ b/src/e_gamma.c @@ -26,7 +26,7 @@ extern int signgam; -double +DLLEXPORT double __ieee754_gamma(double x) { return __ieee754_gamma_r(x,&signgam); diff --git a/src/e_gamma_r.c b/src/e_gamma_r.c index b45b69e..3d4e767 100644 --- a/src/e_gamma_r.c +++ b/src/e_gamma_r.c @@ -25,7 +25,7 @@ #include "openlibm.h" #include "math_private.h" -double +DLLEXPORT double __ieee754_gamma_r(double x, int *signgamp) { return __ieee754_lgamma_r(x,signgamp); diff --git a/src/e_gammaf.c b/src/e_gammaf.c index 05f88d8..7350ab3 100644 --- a/src/e_gammaf.c +++ b/src/e_gammaf.c @@ -27,7 +27,7 @@ extern int signgam; -float +DLLEXPORT float __ieee754_gammaf(float x) { return __ieee754_gammaf_r(x,&signgam); diff --git a/src/e_gammaf_r.c b/src/e_gammaf_r.c index f22df40..68fefd2 100644 --- a/src/e_gammaf_r.c +++ b/src/e_gammaf_r.c @@ -26,7 +26,7 @@ #include "openlibm.h" #include "math_private.h" -float +DLLEXPORT float __ieee754_gammaf_r(float x, int *signgamp) { return __ieee754_lgammaf_r(x,signgamp); diff --git a/src/e_hypot.c b/src/e_hypot.c index db6d0cf..db1745f 100644 --- a/src/e_hypot.c +++ b/src/e_hypot.c @@ -51,7 +51,7 @@ #include "openlibm.h" #include "math_private.h" -double +DLLEXPORT double __ieee754_hypot(double x, double y) { double a,b,t1,t2,y1,y2,w; diff --git a/src/e_hypotf.c b/src/e_hypotf.c index 531f1db..7c2885a 100644 --- a/src/e_hypotf.c +++ b/src/e_hypotf.c @@ -19,7 +19,7 @@ #include "openlibm.h" #include "math_private.h" -float +DLLEXPORT float __ieee754_hypotf(float x, float y) { float a,b,t1,t2,y1,y2,w; diff --git a/src/e_hypotl.c b/src/e_hypotl.c index f7a35ad..269233b 100644 --- a/src/e_hypotl.c +++ b/src/e_hypotl.c @@ -45,7 +45,7 @@ typedef u_int64_t man_t; typedef u_int32_t man_t; #endif -long double +DLLEXPORT long double hypotl(long double x, long double y) { long double a=x,b=y,t1,t2,y1,y2,w; diff --git a/src/e_j0.c b/src/e_j0.c index 8a581a7..aa757bb 100644 --- a/src/e_j0.c +++ b/src/e_j0.c @@ -81,7 +81,7 @@ S04 = 1.16614003333790000205e-09; /* 0x3E1408BC, 0xF4745D8F */ static const double zero = 0.0; -double +DLLEXPORT double __ieee754_j0(double x) { double z, s,c,ss,cc,r,u,v; @@ -142,7 +142,7 @@ v02 = 7.60068627350353253702e-05, /* 0x3F13ECBB, 0xF578C6C1 */ v03 = 2.59150851840457805467e-07, /* 0x3E91642D, 0x7FF202FD */ v04 = 4.41110311332675467403e-10; /* 0x3DFE5018, 0x3BD6D9EF */ -double +DLLEXPORT double __ieee754_y0(double x) { double z, s,c,ss,cc,u,v; diff --git a/src/e_j0f.c b/src/e_j0f.c index c3edd2e..61b59e6 100644 --- a/src/e_j0f.c +++ b/src/e_j0f.c @@ -38,7 +38,7 @@ S04 = 1.1661400734e-09; /* 0x30a045e8 */ static const float zero = 0.0; -float +DLLEXPORT float __ieee754_j0f(float x) { float z, s,c,ss,cc,r,u,v; @@ -99,7 +99,7 @@ v02 = 7.6006865129e-05, /* 0x389f65e0 */ v03 = 2.5915085189e-07, /* 0x348b216c */ v04 = 4.4111031494e-10; /* 0x2ff280c2 */ -float +DLLEXPORT float __ieee754_y0f(float x) { float z, s,c,ss,cc,u,v; diff --git a/src/e_j1.c b/src/e_j1.c index 925d498..dfb8f78 100644 --- a/src/e_j1.c +++ b/src/e_j1.c @@ -82,7 +82,7 @@ s05 = 1.23542274426137913908e-11; /* 0x3DAB2ACF, 0xCFB97ED8 */ static const double zero = 0.0; -double +DLLEXPORT double __ieee754_j1(double x) { double z, s,c,ss,cc,r,u,v,y; @@ -139,7 +139,7 @@ static const double V0[5] = { 1.66559246207992079114e-11, /* 0x3DB25039, 0xDACA772A */ }; -double +DLLEXPORT double __ieee754_y1(double x) { double z, s,c,ss,cc,u,v; diff --git a/src/e_j1f.c b/src/e_j1f.c index 47631e9..aeba0f3 100644 --- a/src/e_j1f.c +++ b/src/e_j1f.c @@ -39,7 +39,7 @@ s05 = 1.2354227016e-11; /* 0x2d59567e */ static const float zero = 0.0; -float +DLLEXPORT float __ieee754_j1f(float x) { float z, s,c,ss,cc,r,u,v,y; @@ -96,7 +96,7 @@ static const float V0[5] = { 1.6655924903e-11, /* 0x2d9281cf */ }; -float +DLLEXPORT float __ieee754_y1f(float x) { float z, s,c,ss,cc,u,v; diff --git a/src/e_jn.c b/src/e_jn.c index dd0d2ac..883e45c 100644 --- a/src/e_jn.c +++ b/src/e_jn.c @@ -50,7 +50,7 @@ one = 1.00000000000000000000e+00; /* 0x3FF00000, 0x00000000 */ static const double zero = 0.00000000000000000000e+00; -double +DLLEXPORT double __ieee754_jn(int n, double x) { int32_t i,hx,ix,lx, sgn; @@ -211,7 +211,7 @@ __ieee754_jn(int n, double x) if(sgn==1) return -b; else return b; } -double +DLLEXPORT double __ieee754_yn(int n, double x) { int32_t i,hx,ix,lx; diff --git a/src/e_jnf.c b/src/e_jnf.c index e6e6e98..30853e4 100644 --- a/src/e_jnf.c +++ b/src/e_jnf.c @@ -25,7 +25,7 @@ one = 1.0000000000e+00; /* 0x3F800000 */ static const float zero = 0.0000000000e+00; -float +DLLEXPORT float __ieee754_jnf(int n, float x) { int32_t i,hx,ix, sgn; @@ -163,7 +163,7 @@ __ieee754_jnf(int n, float x) if(sgn==1) return -b; else return b; } -float +DLLEXPORT float __ieee754_ynf(int n, float x) { int32_t i,hx,ix,ib; diff --git a/src/e_lgamma.c b/src/e_lgamma.c index 4a2e880..469b38f 100644 --- a/src/e_lgamma.c +++ b/src/e_lgamma.c @@ -26,7 +26,7 @@ extern int signgam; -double +DLLEXPORT double __ieee754_lgamma(double x) { return __ieee754_lgamma_r(x,&signgam); diff --git a/src/e_lgamma_r.c b/src/e_lgamma_r.c index 1a4550d..ad2c2ed 100644 --- a/src/e_lgamma_r.c +++ b/src/e_lgamma_r.c @@ -201,7 +201,7 @@ static const double zero= 0.00000000000000000000e+00; } -double +DLLEXPORT double __ieee754_lgamma_r(double x, int *signgamp) { double t,y,z,nadj,p,p1,p2,p3,q,r,w; diff --git a/src/e_lgammaf.c b/src/e_lgammaf.c index a3e5c1b..8ac900c 100644 --- a/src/e_lgammaf.c +++ b/src/e_lgammaf.c @@ -27,7 +27,7 @@ extern int signgam; -float +DLLEXPORT float __ieee754_lgammaf(float x) { return __ieee754_lgammaf_r(x,&signgam); diff --git a/src/e_lgammaf_r.c b/src/e_lgammaf_r.c index 70492c6..5d9fc87 100644 --- a/src/e_lgammaf_r.c +++ b/src/e_lgammaf_r.c @@ -134,7 +134,7 @@ static const float zero= 0.0000000000e+00; } -float +DLLEXPORT float __ieee754_lgammaf_r(float x, int *signgamp) { float t,y,z,nadj,p,p1,p2,p3,q,r,w; diff --git a/src/e_log.c b/src/e_log.c index 81c3f2b..ee73d74 100644 --- a/src/e_log.c +++ b/src/e_log.c @@ -82,7 +82,7 @@ Lg7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */ static const double zero = 0.0; -double +DLLEXPORT double __ieee754_log(double x) { double hfsq,f,s,z,R,w,t1,t2,dk; diff --git a/src/e_log10.c b/src/e_log10.c index f5fda16..a6f9dd6 100644 --- a/src/e_log10.c +++ b/src/e_log10.c @@ -35,7 +35,7 @@ log10_2lo = 3.69423907715893078616e-13; /* 0x3D59FEF3, 0x11F12B36 */ static const double zero = 0.0; -double +DLLEXPORT double __ieee754_log10(double x) { double f,hfsq,hi,lo,r,val_hi,val_lo,w,y,y2; diff --git a/src/e_log10f.c b/src/e_log10f.c index d628260..9ebce9a 100644 --- a/src/e_log10f.c +++ b/src/e_log10f.c @@ -32,7 +32,7 @@ log10_2lo = 7.9034151668e-07; /* 0x355427db */ static const float zero = 0.0; -float +DLLEXPORT float __ieee754_log10f(float x) { float f,hfsq,hi,lo,r,y; diff --git a/src/e_log2.c b/src/e_log2.c index cfc2fd1..0784679 100644 --- a/src/e_log2.c +++ b/src/e_log2.c @@ -35,7 +35,7 @@ ivln2lo = 1.67517131648865118353e-10; /* 0x3de705fc, 0x2eefa200 */ static const double zero = 0.0; -double +DLLEXPORT double __ieee754_log2(double x) { double f,hfsq,hi,lo,r,val_hi,val_lo,w,y; diff --git a/src/e_log2f.c b/src/e_log2f.c index 173efaf..99fa397 100644 --- a/src/e_log2f.c +++ b/src/e_log2f.c @@ -30,7 +30,7 @@ ivln2lo = -1.7605285393e-04; /* 0xb9389ad4 */ static const float zero = 0.0; -float +DLLEXPORT float __ieee754_log2f(float x) { float f,hfsq,hi,lo,r,y; diff --git a/src/e_logf.c b/src/e_logf.c index 8e88abd..c360cb7 100644 --- a/src/e_logf.c +++ b/src/e_logf.c @@ -31,7 +31,7 @@ Lg4 = 0xf89e26.0p-26; /* 0.24279078841 */ static const float zero = 0.0; -float +DLLEXPORT float __ieee754_logf(float x) { float hfsq,f,s,z,R,w,t1,t2,dk; diff --git a/src/e_pow.c b/src/e_pow.c index 863a846..f1a0c32 100644 --- a/src/e_pow.c +++ b/src/e_pow.c @@ -93,7 +93,7 @@ ivln2 = 1.44269504088896338700e+00, /* 0x3FF71547, 0x652B82FE =1/ln2 */ ivln2_h = 1.44269502162933349609e+00, /* 0x3FF71547, 0x60000000 =24b 1/ln2*/ ivln2_l = 1.92596299112661746887e-08; /* 0x3E54AE0B, 0xF85DDF44 =1/ln2 tail*/ -double +DLLEXPORT double __ieee754_pow(double x, double y) { double z,ax,z_h,z_l,p_h,p_l; diff --git a/src/e_powf.c b/src/e_powf.c index 08886a0..c1e9e8b 100644 --- a/src/e_powf.c +++ b/src/e_powf.c @@ -52,7 +52,7 @@ ivln2 = 1.4426950216e+00, /* 0x3fb8aa3b =1/ln2 */ ivln2_h = 1.4426879883e+00, /* 0x3fb8aa00 =16b 1/ln2*/ ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/ -float +DLLEXPORT float __ieee754_powf(float x, float y) { float z,ax,z_h,z_l,p_h,p_l; diff --git a/src/e_rem_pio2.c b/src/e_rem_pio2.c index 02687cc..2c6aefc 100644 --- a/src/e_rem_pio2.c +++ b/src/e_rem_pio2.c @@ -52,7 +52,7 @@ pio2_3t = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */ extern #endif //__inline int -int +DLLEXPORT int __ieee754_rem_pio2(double x, double *y) { double z,w,t,r,fn; diff --git a/src/e_rem_pio2f.c b/src/e_rem_pio2f.c index 8fe2790..9f2dc44 100644 --- a/src/e_rem_pio2f.c +++ b/src/e_rem_pio2f.c @@ -44,7 +44,7 @@ pio2_1t = 1.58932547735281966916e-08; /* 0x3E5110b4, 0x611A6263 */ extern #endif //__inline int -int +DLLEXPORT int __ieee754_rem_pio2f(float x, double *y) { double w,r,fn; diff --git a/src/e_remainder.c b/src/e_remainder.c index 70356d5..1b1410f 100644 --- a/src/e_remainder.c +++ b/src/e_remainder.c @@ -31,7 +31,7 @@ static const double zero = 0.0; -double +DLLEXPORT double __ieee754_remainder(double x, double p) { int32_t hx,hp; diff --git a/src/e_remainderf.c b/src/e_remainderf.c index b2ca56c..867c40a 100644 --- a/src/e_remainderf.c +++ b/src/e_remainderf.c @@ -22,7 +22,7 @@ static const float zero = 0.0; -float +DLLEXPORT float __ieee754_remainderf(float x, float p) { int32_t hx,hp; diff --git a/src/e_remainderl.c b/src/e_remainderl.c index ddfe9cf..af92ff5 100644 --- a/src/e_remainderl.c +++ b/src/e_remainderl.c @@ -28,8 +28,9 @@ //__FBSDID("$FreeBSD: src/lib/msun/src/e_remainderl.c,v 1.1 2008/03/30 20:47:42 das Exp $"); #include +#include "math_private.h" -long double +DLLEXPORT long double remainderl(long double x, long double y) { int quo; diff --git a/src/e_scalb.c b/src/e_scalb.c index e78baf6..d575100 100644 --- a/src/e_scalb.c +++ b/src/e_scalb.c @@ -24,10 +24,10 @@ #include "math_private.h" #ifdef _SCALB_INT -double +DLLEXPORT double __ieee754_scalb(double x, int fn) #else -double +DLLEXPORT double __ieee754_scalb(double x, double fn) #endif { diff --git a/src/e_scalbf.c b/src/e_scalbf.c index 73ebcb6..d506719 100644 --- a/src/e_scalbf.c +++ b/src/e_scalbf.c @@ -20,10 +20,10 @@ #include "math_private.h" #ifdef _SCALB_INT -float +DLLEXPORT float __ieee754_scalbf(float x, int fn) #else -float +DLLEXPORT float __ieee754_scalbf(float x, float fn) #endif { diff --git a/src/e_sinh.c b/src/e_sinh.c index 2d8b5c2..5fc451e 100644 --- a/src/e_sinh.c +++ b/src/e_sinh.c @@ -37,7 +37,7 @@ static const double one = 1.0, shuge = 1.0e307; -double +DLLEXPORT double __ieee754_sinh(double x) { double t,h; diff --git a/src/e_sinhf.c b/src/e_sinhf.c index 4dbbdb1..9a97834 100644 --- a/src/e_sinhf.c +++ b/src/e_sinhf.c @@ -21,7 +21,7 @@ static const float one = 1.0, shuge = 1.0e37; -float +DLLEXPORT float __ieee754_sinhf(float x) { float t,h; diff --git a/src/e_sqrt.c b/src/e_sqrt.c index ca2294e..df6eec4 100644 --- a/src/e_sqrt.c +++ b/src/e_sqrt.c @@ -91,7 +91,7 @@ static const double one = 1.0, tiny=1.0e-300; -double +DLLEXPORT double __ieee754_sqrt(double x) { double z; diff --git a/src/e_sqrtf.c b/src/e_sqrtf.c index e6afa9f..e842efe 100644 --- a/src/e_sqrtf.c +++ b/src/e_sqrtf.c @@ -18,7 +18,7 @@ static const float one = 1.0, tiny=1.0e-30; -float +DLLEXPORT float __ieee754_sqrtf(float x) { float z; diff --git a/src/e_sqrtl.c b/src/e_sqrtl.c index ff1ced7..7b2ea83 100644 --- a/src/e_sqrtl.c +++ b/src/e_sqrtl.c @@ -32,6 +32,7 @@ #include "fpmath.h" #include "openlibm.h" +#include "math_private.h" /* Return (x + ulp) for normal positive x. Assumes no overflow. */ static inline long double @@ -74,7 +75,7 @@ dec(long double x) * if possible. */ -long double +DLLEXPORT long double sqrtl(long double x) { union IEEEl2bits u; diff --git a/src/k_cos.c b/src/k_cos.c index eabd230..b468594 100644 --- a/src/k_cos.c +++ b/src/k_cos.c @@ -65,7 +65,7 @@ C4 = -2.75573143513906633035e-07, /* 0xBE927E4F, 0x809C52AD */ C5 = 2.08757232129817482790e-09, /* 0x3E21EE9E, 0xBDB4B1C4 */ C6 = -1.13596475577881948265e-11; /* 0xBDA8FAE9, 0xBE8838D4 */ -double +DLLEXPORT double __kernel_cos(double x, double y) { double hz,z,r,w; diff --git a/src/k_cosf.c b/src/k_cosf.c index f4b8fc7..6daeb65 100644 --- a/src/k_cosf.c +++ b/src/k_cosf.c @@ -34,7 +34,7 @@ C3 = 0x199342e0ee5069.0p-68; /* 0.0000243904487962774090654 */ extern #endif //__inline float -float +DLLEXPORT float __kernel_cosdf(double x) { double r, w, z; diff --git a/src/k_exp.c b/src/k_exp.c index b512c78..8735088 100644 --- a/src/k_exp.c +++ b/src/k_exp.c @@ -71,7 +71,7 @@ __frexp_exp(double x, int *expt) * has filtered out very large x, for which overflow would be inevitable. */ -double +DLLEXPORT double __ldexp_exp(double x, int expt) { double exp_x, scale; @@ -83,7 +83,7 @@ __ldexp_exp(double x, int expt) return (exp_x * scale); } -double complex +DLLEXPORT double complex __ldexp_cexp(double complex z, int expt) { double x, y, exp_x, scale1, scale2; diff --git a/src/k_expf.c b/src/k_expf.c index f4e16ff..c94da5c 100644 --- a/src/k_expf.c +++ b/src/k_expf.c @@ -54,7 +54,7 @@ __frexp_expf(float x, int *expt) return (exp_x); } -float +DLLEXPORT float __ldexp_expf(float x, int expt) { float exp_x, scale; @@ -66,7 +66,7 @@ __ldexp_expf(float x, int expt) return (exp_x * scale); } -float complex +DLLEXPORT float complex __ldexp_cexpf(float complex z, int expt) { float x, y, exp_x, scale1, scale2; diff --git a/src/k_rem_pio2.c b/src/k_rem_pio2.c index 6ce50b9..ba6fd3c 100644 --- a/src/k_rem_pio2.c +++ b/src/k_rem_pio2.c @@ -290,7 +290,7 @@ one = 1.0, two24 = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */ twon24 = 5.96046447753906250000e-08; /* 0x3E700000, 0x00000000 */ -int +DLLEXPORT int __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec) { int32_t jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih; diff --git a/src/k_sin.c b/src/k_sin.c index 4969844..8b7c1e5 100644 --- a/src/k_sin.c +++ b/src/k_sin.c @@ -56,7 +56,7 @@ S4 = 2.75573137070700676789e-06, /* 0x3EC71DE3, 0x57B1FE7D */ S5 = -2.50507602534068634195e-08, /* 0xBE5AE5E6, 0x8A2B9CEB */ S6 = 1.58969099521155010221e-10; /* 0x3DE5D93A, 0x5ACFD57C */ -double +DLLEXPORT double __kernel_sin(double x, double y, int iy) { double z,r,v,w; diff --git a/src/k_sinf.c b/src/k_sinf.c index bf9039a..374d610 100644 --- a/src/k_sinf.c +++ b/src/k_sinf.c @@ -33,7 +33,7 @@ S4 = 0x16cd878c3b46a7.0p-71; /* 0.0000027183114939898219064 */ extern #endif //__inline float -float +DLLEXPORT float __kernel_sindf(double x) { double r, s, w, z; diff --git a/src/k_tan.c b/src/k_tan.c index d56297f..090304c 100644 --- a/src/k_tan.c +++ b/src/k_tan.c @@ -75,7 +75,7 @@ static const double xxx[] = { #define T xxx /* INDENT ON */ -double +DLLEXPORT double __kernel_tan(double x, double y, int iy) { double z, r, v, w, s; int32_t ix, hx; diff --git a/src/k_tanf.c b/src/k_tanf.c index c4c25d0..3dac110 100644 --- a/src/k_tanf.c +++ b/src/k_tanf.c @@ -36,7 +36,7 @@ T[] = { extern #endif //__inline float -float +DLLEXPORT float __kernel_tandf(double x, int iy) { double z,r,w,s,t,u; diff --git a/src/math_private.h b/src/math_private.h index 5fe8cd6..43781b4 100644 --- a/src/math_private.h +++ b/src/math_private.h @@ -442,4 +442,14 @@ long double __kernel_sinl(long double, long double, int); long double __kernel_cosl(long double, long double); long double __kernel_tanl(long double, long double, int); +#ifdef _WIN32 +# ifdef IMPORT_EXPORTS +# define DLLEXPORT __declspec(dllimport) +# else +# define DLLEXPORT __declspec(dllexport) +# endif +#else +#define DLLEXPORT __attribute__ ((visibility("default"))) +#endif + #endif /* !_MATH_PRIVATE_H_ */ diff --git a/src/s_asinh.c b/src/s_asinh.c index 36f0489..70d1002 100644 --- a/src/s_asinh.c +++ b/src/s_asinh.c @@ -32,7 +32,7 @@ one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ ln2 = 6.93147180559945286227e-01, /* 0x3FE62E42, 0xFEFA39EF */ huge= 1.00000000000000000000e+300; -double +DLLEXPORT double asinh(double x) { double t,w; diff --git a/src/s_asinhf.c b/src/s_asinhf.c index 9a753c5..8a988df 100644 --- a/src/s_asinhf.c +++ b/src/s_asinhf.c @@ -24,7 +24,7 @@ one = 1.0000000000e+00, /* 0x3F800000 */ ln2 = 6.9314718246e-01, /* 0x3f317218 */ huge= 1.0000000000e+30; -float +DLLEXPORT float asinhf(float x) { float t,w; diff --git a/src/s_atan.c b/src/s_atan.c index 02c7a8d..60d8df8 100644 --- a/src/s_atan.c +++ b/src/s_atan.c @@ -70,7 +70,7 @@ static const double aT[] = { one = 1.0, huge = 1.0e300; -double +DLLEXPORT double atan(double x) { double w,s1,s2,z; diff --git a/src/s_atanf.c b/src/s_atanf.c index db78fc5..505c3e8 100644 --- a/src/s_atanf.c +++ b/src/s_atanf.c @@ -45,7 +45,7 @@ static const float one = 1.0, huge = 1.0e30; -float +DLLEXPORT float atanf(float x) { float w,s1,s2,z; diff --git a/src/s_atanl.c b/src/s_atanl.c index e4e8459..ee47f4e 100644 --- a/src/s_atanl.c +++ b/src/s_atanl.c @@ -29,7 +29,7 @@ static const long double one = 1.0, huge = 1.0e300; -long double +DLLEXPORT long double atanl(long double x) { union IEEEl2bits u; diff --git a/src/s_carg.c b/src/s_carg.c index 50d22b1..195feb4 100644 --- a/src/s_carg.c +++ b/src/s_carg.c @@ -29,8 +29,9 @@ #include #include +#include "math_private.h" -double +DLLEXPORT double carg(double complex z) { diff --git a/src/s_cargf.c b/src/s_cargf.c index 9ef6f1c..7592b1f 100644 --- a/src/s_cargf.c +++ b/src/s_cargf.c @@ -29,8 +29,9 @@ #include #include +#include "math_private.h" -float +DLLEXPORT float cargf(float complex z) { diff --git a/src/s_cargl.c b/src/s_cargl.c index 7b831e3..2a725c9 100644 --- a/src/s_cargl.c +++ b/src/s_cargl.c @@ -29,8 +29,9 @@ #include #include +#include "math_private.h" -long double +DLLEXPORT long double cargl(long double complex z) { diff --git a/src/s_cbrt.c b/src/s_cbrt.c index 57f13d3..2fccb92 100644 --- a/src/s_cbrt.c +++ b/src/s_cbrt.c @@ -33,7 +33,7 @@ P2 = 1.621429720105354466140, /* 0x3ff9f160, 0x4a49d6c2 */ P3 = -0.758397934778766047437, /* 0xbfe844cb, 0xbee751d9 */ P4 = 0.145996192886612446982; /* 0x3fc2b000, 0xd4e4edd7 */ -double +DLLEXPORT double cbrt(double x) { int32_t hx; diff --git a/src/s_cbrtf.c b/src/s_cbrtf.c index 9422505..ccb7957 100644 --- a/src/s_cbrtf.c +++ b/src/s_cbrtf.c @@ -27,7 +27,7 @@ static const unsigned B1 = 709958130, /* B1 = (127-127.0/3-0.03306235651)*2**23 */ B2 = 642849266; /* B2 = (127-127.0/3-24/3-0.03306235651)*2**23 */ -float +DLLEXPORT float cbrtf(float x) { double r,T; diff --git a/src/s_cbrtl.c b/src/s_cbrtl.c index e7c2d10..08bfacc 100644 --- a/src/s_cbrtl.c +++ b/src/s_cbrtl.c @@ -33,7 +33,7 @@ static const unsigned B1 = 709958130; /* B1 = (127-127.0/3-0.03306235651)*2**23 */ -long double +DLLEXPORT long double cbrtl(long double x) { union IEEEl2bits u, v; diff --git a/src/s_ccosh.c b/src/s_ccosh.c index e6ed10c..8f55f42 100644 --- a/src/s_ccosh.c +++ b/src/s_ccosh.c @@ -44,7 +44,7 @@ static const double huge = 0x1p1023; -double complex +DLLEXPORT double complex ccosh(double complex z) { double x, y, h; @@ -146,7 +146,7 @@ ccosh(double complex z) return (cpack((x * x) * (y - y), (x + x) * (y - y))); } -double complex +DLLEXPORT double complex ccos(double complex z) { diff --git a/src/s_ccoshf.c b/src/s_ccoshf.c index ca6131b..6fcf836 100644 --- a/src/s_ccoshf.c +++ b/src/s_ccoshf.c @@ -38,7 +38,7 @@ static const float huge = 0x1p127; -float complex +DLLEXPORT float complex ccoshf(float complex z) { float x, y, h; @@ -96,7 +96,7 @@ ccoshf(float complex z) return (cpackf((x * x) * (y - y), (x + x) * (y - y))); } -float complex +DLLEXPORT float complex ccosf(float complex z) { diff --git a/src/s_ceil.c b/src/s_ceil.c index 7646153..7c02043 100644 --- a/src/s_ceil.c +++ b/src/s_ceil.c @@ -29,7 +29,7 @@ static const double huge = 1.0e300; -double +DLLEXPORT double ceil(double x) { int32_t i0,i1,j0; diff --git a/src/s_ceilf.c b/src/s_ceilf.c index 10659ab..8fb20e5 100644 --- a/src/s_ceilf.c +++ b/src/s_ceilf.c @@ -21,7 +21,7 @@ static const float huge = 1.0e30; -float +DLLEXPORT float ceilf(float x) { int32_t i0,j0; diff --git a/src/s_ceill.c b/src/s_ceill.c index 2035e98..6afc2be 100644 --- a/src/s_ceill.c +++ b/src/s_ceill.c @@ -52,7 +52,7 @@ static const long double huge = 1.0e300; -long double +DLLEXPORT long double ceill(long double x) { union IEEEl2bits u = { .e = x }; diff --git a/src/s_cexp.c b/src/s_cexp.c index b1c6b91..38e6653 100644 --- a/src/s_cexp.c +++ b/src/s_cexp.c @@ -36,7 +36,7 @@ static const u_int32_t exp_ovfl = 0x40862e42, /* high bits of MAX_EXP * ln2 ~= 710 */ cexp_ovfl = 0x4096b8e4; /* (MAX_EXP - MIN_DENORM_EXP) * ln2 */ -double complex +DLLEXPORT double complex cexp(double complex z) { double x, y, exp_x; diff --git a/src/s_cexpf.c b/src/s_cexpf.c index b2453c8..90eab17 100644 --- a/src/s_cexpf.c +++ b/src/s_cexpf.c @@ -36,7 +36,7 @@ static const u_int32_t exp_ovfl = 0x42b17218, /* MAX_EXP * ln2 ~= 88.722839355 */ cexp_ovfl = 0x43400074; /* (MAX_EXP - MIN_DENORM_EXP) * ln2 */ -float complex +DLLEXPORT float complex cexpf(float complex z) { float x, y, exp_x; diff --git a/src/s_cimag.c b/src/s_cimag.c index a14afa7..3b69c14 100644 --- a/src/s_cimag.c +++ b/src/s_cimag.c @@ -29,7 +29,7 @@ #include #include "math_private.h" -double +DLLEXPORT double cimag(double complex z) { const double_complex z1 = { .f = z }; diff --git a/src/s_cimagf.c b/src/s_cimagf.c index dabb09a..1453cac 100644 --- a/src/s_cimagf.c +++ b/src/s_cimagf.c @@ -29,7 +29,7 @@ #include #include "math_private.h" -float +DLLEXPORT float cimagf(float complex z) { const float_complex z1 = { .f = z }; diff --git a/src/s_cimagl.c b/src/s_cimagl.c index 89f4bc3..5f8876c 100644 --- a/src/s_cimagl.c +++ b/src/s_cimagl.c @@ -29,7 +29,7 @@ #include #include "math_private.h" -long double +DLLEXPORT long double cimagl(long double complex z) { const long_double_complex z1 = { .f = z }; diff --git a/src/s_conj.c b/src/s_conj.c index 4c1ae3c..b7a63d1 100644 --- a/src/s_conj.c +++ b/src/s_conj.c @@ -30,7 +30,7 @@ #include "math_private.h" -double complex +DLLEXPORT double complex conj(double complex z) { diff --git a/src/s_conjf.c b/src/s_conjf.c index 96b489a..02793c4 100644 --- a/src/s_conjf.c +++ b/src/s_conjf.c @@ -30,7 +30,7 @@ #include "math_private.h" -float complex +DLLEXPORT float complex conjf(float complex z) { diff --git a/src/s_conjl.c b/src/s_conjl.c index 7047ff4..774b8f6 100644 --- a/src/s_conjl.c +++ b/src/s_conjl.c @@ -30,7 +30,7 @@ #include "math_private.h" -long double complex +DLLEXPORT long double complex conjl(long double complex z) { diff --git a/src/s_copysign.c b/src/s_copysign.c index 7708ace..12b777d 100644 --- a/src/s_copysign.c +++ b/src/s_copysign.c @@ -22,7 +22,7 @@ #include "openlibm.h" #include "math_private.h" -double +DLLEXPORT double copysign(double x, double y) { u_int32_t hx,hy; diff --git a/src/s_copysignf.c b/src/s_copysignf.c index 34ace7e..f7e8415 100644 --- a/src/s_copysignf.c +++ b/src/s_copysignf.c @@ -25,7 +25,7 @@ #include "openlibm.h" #include "math_private.h" -float +DLLEXPORT float copysignf(float x, float y) { u_int32_t ix,iy; diff --git a/src/s_copysignl.c b/src/s_copysignl.c index b6f6f28..b648443 100644 --- a/src/s_copysignl.c +++ b/src/s_copysignl.c @@ -27,10 +27,10 @@ */ #include - +#include "math_private.h" #include "fpmath.h" -long double +DLLEXPORT long double copysignl(long double x, long double y) { union IEEEl2bits ux, uy; diff --git a/src/s_cos.c b/src/s_cos.c index 20a2fe7..2d3c4bb 100644 --- a/src/s_cos.c +++ b/src/s_cos.c @@ -51,7 +51,7 @@ #include "math_private.h" //#include "e_rem_pio2.c" -double +DLLEXPORT double cos(double x) { double y[2],z=0.0; diff --git a/src/s_cosf.c b/src/s_cosf.c index 1faf534..1d4e725 100644 --- a/src/s_cosf.c +++ b/src/s_cosf.c @@ -35,7 +35,7 @@ c2pio2 = 2*M_PI_2, /* 0x400921FB, 0x54442D18 */ c3pio2 = 3*M_PI_2, /* 0x4012D97C, 0x7F3321D2 */ c4pio2 = 4*M_PI_2; /* 0x401921FB, 0x54442D18 */ -float +DLLEXPORT float cosf(float x) { double y; diff --git a/src/s_cosl.c b/src/s_cosl.c index 00b9c87..d9147ae 100644 --- a/src/s_cosl.c +++ b/src/s_cosl.c @@ -44,7 +44,7 @@ #error "Unsupported long double format" #endif -long double +DLLEXPORT long double cosl(long double x) { union IEEEl2bits z; diff --git a/src/s_cpow.c b/src/s_cpow.c index 044fe90..9c618b4 100644 --- a/src/s_cpow.c +++ b/src/s_cpow.c @@ -47,8 +47,9 @@ #include #include #include +#include "math_private.h" -double complex +DLLEXPORT double complex cpow(double complex a, double complex z) { double complex w; diff --git a/src/s_cpowf.c b/src/s_cpowf.c index 994fa06..a01398b 100644 --- a/src/s_cpowf.c +++ b/src/s_cpowf.c @@ -46,8 +46,9 @@ #include #include +#include "math_private.h" -float complex +DLLEXPORT float complex cpowf(float complex a, float complex z) { float complex w; diff --git a/src/s_cpowl.c b/src/s_cpowl.c index 69d14d2..3103763 100644 --- a/src/s_cpowl.c +++ b/src/s_cpowl.c @@ -47,8 +47,9 @@ #include #include +#include "math_private.h" -long double complex +DLLEXPORT long double complex cpowl(long double complex a, long double complex z) { long double complex w; diff --git a/src/s_cproj.c b/src/s_cproj.c index 16679d8..67f0bd0 100644 --- a/src/s_cproj.c +++ b/src/s_cproj.c @@ -32,7 +32,7 @@ #include "math_private.h" -double complex +DLLEXPORT double complex cproj(double complex z) { diff --git a/src/s_cprojf.c b/src/s_cprojf.c index 410ebe8..4750b6b 100644 --- a/src/s_cprojf.c +++ b/src/s_cprojf.c @@ -32,7 +32,7 @@ #include "math_private.h" -float complex +DLLEXPORT float complex cprojf(float complex z) { diff --git a/src/s_cprojl.c b/src/s_cprojl.c index 3edfed1..a048107 100644 --- a/src/s_cprojl.c +++ b/src/s_cprojl.c @@ -32,7 +32,7 @@ #include "math_private.h" -long double complex +DLLEXPORT long double complex cprojl(long double complex z) { diff --git a/src/s_creal.c b/src/s_creal.c index ad14cdf..faf5999 100644 --- a/src/s_creal.c +++ b/src/s_creal.c @@ -27,8 +27,9 @@ */ #include +#include "math_private.h" -double +DLLEXPORT double creal(double complex z) { return z; diff --git a/src/s_crealf.c b/src/s_crealf.c index a5c1562..f17d595 100644 --- a/src/s_crealf.c +++ b/src/s_crealf.c @@ -27,8 +27,9 @@ */ #include +#include "math_private.h" -float +DLLEXPORT float crealf(float complex z) { return z; diff --git a/src/s_creall.c b/src/s_creall.c index 1531d16..2d1ded7 100644 --- a/src/s_creall.c +++ b/src/s_creall.c @@ -27,8 +27,9 @@ */ #include +#include "math_private.h" -long double +DLLEXPORT long double creall(long double complex z) { return z; diff --git a/src/s_csinh.c b/src/s_csinh.c index 69a6415..8402c49 100644 --- a/src/s_csinh.c +++ b/src/s_csinh.c @@ -44,7 +44,7 @@ static const double huge = 0x1p1023; -double complex +DLLEXPORT double complex csinh(double complex z) { double x, y, h; @@ -147,7 +147,7 @@ csinh(double complex z) return (cpack((x * x) * (y - y), (x + x) * (y - y))); } -double complex +DLLEXPORT double complex csin(double complex z) { diff --git a/src/s_csinhf.c b/src/s_csinhf.c index 583ff18..78ed180 100644 --- a/src/s_csinhf.c +++ b/src/s_csinhf.c @@ -38,7 +38,7 @@ static const float huge = 0x1p127; -float complex +DLLEXPORT float complex csinhf(float complex z) { float x, y, h; @@ -96,7 +96,7 @@ csinhf(float complex z) return (cpackf((x * x) * (y - y), (x + x) * (y - y))); } -float complex +DLLEXPORT float complex csinf(float complex z) { diff --git a/src/s_csqrt.c b/src/s_csqrt.c index 8e20850..efd0701 100644 --- a/src/s_csqrt.c +++ b/src/s_csqrt.c @@ -47,7 +47,7 @@ /* We risk spurious overflow for components >= DBL_MAX / (1 + sqrt(2)). */ #define THRESH 0x1.a827999fcef32p+1022 -double complex +DLLEXPORT double complex csqrt(double complex z) { double complex result; diff --git a/src/s_csqrtf.c b/src/s_csqrtf.c index f94c997..7a79c88 100644 --- a/src/s_csqrtf.c +++ b/src/s_csqrtf.c @@ -43,7 +43,7 @@ #pragma STDC CX_LIMITED_RANGE ON #endif -float complex +DLLEXPORT float complex csqrtf(float complex z) { float a = crealf(z), b = cimagf(z); diff --git a/src/s_csqrtl.c b/src/s_csqrtl.c index 8983c2a..c542a13 100644 --- a/src/s_csqrtl.c +++ b/src/s_csqrtl.c @@ -46,7 +46,7 @@ /* We risk spurious overflow for components >= LDBL_MAX / (1 + sqrt(2)). */ #define THRESH (LDBL_MAX / 2.414213562373095048801688724209698L) -long double complex +DLLEXPORT long double complex csqrtl(long double complex z) { long double complex result; diff --git a/src/s_ctanh.c b/src/s_ctanh.c index 073d661..d26d128 100644 --- a/src/s_ctanh.c +++ b/src/s_ctanh.c @@ -71,7 +71,7 @@ #include "math_private.h" -double complex +DLLEXPORT double complex ctanh(double complex z) { double x, y; @@ -134,7 +134,7 @@ ctanh(double complex z) return (cpack((beta * rho * s) / denom, t / denom)); } -double complex +DLLEXPORT double complex ctan(double complex z) { diff --git a/src/s_ctanhf.c b/src/s_ctanhf.c index a2a6c49..c123b54 100644 --- a/src/s_ctanhf.c +++ b/src/s_ctanhf.c @@ -36,7 +36,7 @@ #include "math_private.h" -float complex +DLLEXPORT float complex ctanhf(float complex z) { float x, y; @@ -74,7 +74,7 @@ ctanhf(float complex z) return (cpackf((beta * rho * s) / denom, t / denom)); } -float complex +DLLEXPORT float complex ctanf(float complex z) { diff --git a/src/s_erf.c b/src/s_erf.c index 6f4fa23..d6504b5 100644 --- a/src/s_erf.c +++ b/src/s_erf.c @@ -186,7 +186,7 @@ sb5 = 2.55305040643316442583e+03, /* 0x40A3F219, 0xCEDF3BE6 */ sb6 = 4.74528541206955367215e+02, /* 0x407DA874, 0xE79FE763 */ sb7 = -2.24409524465858183362e+01; /* 0xC03670E2, 0x42712D62 */ -double +DLLEXPORT double erf(double x) { int32_t hx,ix,i; @@ -238,7 +238,7 @@ erf(double x) if(hx>=0) return one-r/x; else return r/x-one; } -double +DLLEXPORT double erfc(double x) { int32_t hx,ix; diff --git a/src/s_erff.c b/src/s_erff.c index 3351c47..29a8d80 100644 --- a/src/s_erff.c +++ b/src/s_erff.c @@ -94,7 +94,7 @@ sb5 = 2.5530502930e+03, /* 0x451f90ce */ sb6 = 4.7452853394e+02, /* 0x43ed43a7 */ sb7 = -2.2440952301e+01; /* 0xc1b38712 */ -float +DLLEXPORT float erff(float x) { int32_t hx,ix,i; @@ -147,7 +147,7 @@ erff(float x) if(hx>=0) return one-r/x; else return r/x-one; } -float +DLLEXPORT float erfcf(float x) { int32_t hx,ix; diff --git a/src/s_exp2.c b/src/s_exp2.c index f76993c..598268b 100644 --- a/src/s_exp2.c +++ b/src/s_exp2.c @@ -337,7 +337,7 @@ static const double tbl[TBLSIZE * 2] = { * Gal, S. and Bachelis, B. An Accurate Elementary Mathematical Library * for the IEEE Floating Point Standard. TOMS 17(1), 26-46 (1991). */ -double +DLLEXPORT double exp2(double x) { double r, t, twopk, twopkp1000, z; diff --git a/src/s_exp2f.c b/src/s_exp2f.c index 4623889..9409bd4 100644 --- a/src/s_exp2f.c +++ b/src/s_exp2f.c @@ -90,7 +90,7 @@ static const double exp2ft[TBLSIZE] = { * Tang, P. Table-driven Implementation of the Exponential Function * in IEEE Floating-Point Arithmetic. TOMS 15(2), 144-157 (1989). */ -float +DLLEXPORT float exp2f(float x) { double tv, twopk, u, z; diff --git a/src/s_expm1.c b/src/s_expm1.c index 8f002c8..ff99652 100644 --- a/src/s_expm1.c +++ b/src/s_expm1.c @@ -128,7 +128,7 @@ Q3 = -7.93650757867487942473e-05, /* BF14CE19 9EAADBB7 */ Q4 = 4.00821782732936239552e-06, /* 3ED0CFCA 86E65239 */ Q5 = -2.01099218183624371326e-07; /* BE8AFDB7 6E09C32D */ -double +DLLEXPORT double expm1(double x) { double y,hi,lo,c,t,e,hxs,hfx,r1,twopk; diff --git a/src/s_expm1f.c b/src/s_expm1f.c index 1ea85a8..9d29ac4 100644 --- a/src/s_expm1f.c +++ b/src/s_expm1f.c @@ -37,7 +37,7 @@ invln2 = 1.4426950216e+00,/* 0x3fb8aa3b */ Q1 = -3.3333212137e-2, /* -0x888868.0p-28 */ Q2 = 1.5807170421e-3; /* 0xcf3010.0p-33 */ -float +DLLEXPORT float expm1f(float x) { float y,hi,lo,c,t,e,hxs,hfx,r1,twopk; diff --git a/src/s_fabs.c b/src/s_fabs.c index 064a6e2..6c53c80 100644 --- a/src/s_fabs.c +++ b/src/s_fabs.c @@ -17,7 +17,7 @@ #include "openlibm.h" #include "math_private.h" -double +DLLEXPORT double fabs(double x) { u_int32_t high; diff --git a/src/s_fabsf.c b/src/s_fabsf.c index 6b9f4bc..f5b4525 100644 --- a/src/s_fabsf.c +++ b/src/s_fabsf.c @@ -23,7 +23,7 @@ #include "openlibm.h" #include "math_private.h" -float +DLLEXPORT float fabsf(float x) { u_int32_t ix; diff --git a/src/s_fabsl.c b/src/s_fabsl.c index c4d1b44..68e922b 100644 --- a/src/s_fabsl.c +++ b/src/s_fabsl.c @@ -29,10 +29,10 @@ */ #include - +#include "math_private.h" #include "fpmath.h" -long double +DLLEXPORT long double fabsl(long double x) { union IEEEl2bits u; diff --git a/src/s_fdim.c b/src/s_fdim.c index 43f4985..12dee6b 100644 --- a/src/s_fdim.c +++ b/src/s_fdim.c @@ -26,11 +26,11 @@ #include "cdefs-compat.h" //__FBSDID("$FreeBSD: src/lib/msun/src/s_fdim.c,v 1.1 2004/06/30 07:04:01 das Exp $"); - #include +#include "math_private.h" #define DECL(type, fn) \ -type \ +DLLEXPORT type \ fn(type x, type y) \ { \ \ diff --git a/src/s_finite.c b/src/s_finite.c index c5962f7..46f84e7 100644 --- a/src/s_finite.c +++ b/src/s_finite.c @@ -21,7 +21,8 @@ #include "openlibm.h" #include "math_private.h" - int finite(double x) +DLLEXPORT int +finite(double x) { int32_t hx; GET_HIGH_WORD(hx,x); diff --git a/src/s_finitef.c b/src/s_finitef.c index 779f24b..6d189a5 100644 --- a/src/s_finitef.c +++ b/src/s_finitef.c @@ -24,7 +24,8 @@ #include "openlibm.h" #include "math_private.h" - int finitef(float x) +DLLEXPORT int +finitef(float x) { int32_t ix; GET_FLOAT_WORD(ix,x); diff --git a/src/s_floor.c b/src/s_floor.c index 39e08c9..95891ef 100644 --- a/src/s_floor.c +++ b/src/s_floor.c @@ -29,7 +29,7 @@ static const double huge = 1.0e300; -double +DLLEXPORT double floor(double x) { int32_t i0,i1,j0; diff --git a/src/s_floorf.c b/src/s_floorf.c index 7676bd2..678bb11 100644 --- a/src/s_floorf.c +++ b/src/s_floorf.c @@ -30,7 +30,7 @@ static const float huge = 1.0e30; -float +DLLEXPORT float floorf(float x) { int32_t i0,j0; diff --git a/src/s_floorl.c b/src/s_floorl.c index 2d4ad46..df578cc 100644 --- a/src/s_floorl.c +++ b/src/s_floorl.c @@ -25,6 +25,7 @@ #include #include +#include "math_private.h" #include #include "fpmath.h" @@ -51,7 +52,7 @@ static const long double huge = 1.0e300; -long double +DLLEXPORT long double floorl(long double x) { union IEEEl2bits u = { .e = x }; diff --git a/src/s_fma.c b/src/s_fma.c index 757eea4..1c93f55 100644 --- a/src/s_fma.c +++ b/src/s_fma.c @@ -174,7 +174,7 @@ dd_mul(double a, double b) * Hardware instructions should be used on architectures that support it, * since this implementation will likely be several times slower. */ -double +DLLEXPORT double fma(double x, double y, double z) { double xs, ys, zs, adj; diff --git a/src/s_fmaf.c b/src/s_fmaf.c index 37b1618..da0e019 100644 --- a/src/s_fmaf.c +++ b/src/s_fmaf.c @@ -39,7 +39,7 @@ * direct double-precision arithmetic suffices, except where double * rounding occurs. */ -float +DLLEXPORT float fmaf(float x, float y, float z) { double xy, result; diff --git a/src/s_fmal.c b/src/s_fmal.c index c484448..1d6b6b8 100644 --- a/src/s_fmal.c +++ b/src/s_fmal.c @@ -30,7 +30,7 @@ #include #include #include - +#include "math_private.h" #include "fpmath.h" /* @@ -162,7 +162,7 @@ dd_mul(long double a, long double b) * Dekker, T. A Floating-Point Technique for Extending the * Available Precision. Numer. Math. 18, 224-242 (1971). */ -long double +DLLEXPORT long double fmal(long double x, long double y, long double z) { long double xs, ys, zs, adj; diff --git a/src/s_fmax.c b/src/s_fmax.c index a1c2132..5df93d8 100644 --- a/src/s_fmax.c +++ b/src/s_fmax.c @@ -28,10 +28,10 @@ //__FBSDID("$FreeBSD: src/lib/msun/src/s_fmax.c,v 1.1 2004/06/30 07:04:01 das Exp $"); #include - +#include "math_private.h" #include "fpmath.h" -double +DLLEXPORT double fmax(double x, double y) { union IEEEd2bits u[2]; diff --git a/src/s_fmaxf.c b/src/s_fmaxf.c index abe6d27..e1744c0 100644 --- a/src/s_fmaxf.c +++ b/src/s_fmaxf.c @@ -28,10 +28,10 @@ //__FBSDID("$FreeBSD: src/lib/msun/src/s_fmaxf.c,v 1.1 2004/06/30 07:04:01 das Exp $"); #include - +#include "math_private.h" #include "fpmath.h" -float +DLLEXPORT float fmaxf(float x, float y) { union IEEEf2bits u[2]; diff --git a/src/s_fmaxl.c b/src/s_fmaxl.c index 76d4809..b77fbca 100644 --- a/src/s_fmaxl.c +++ b/src/s_fmaxl.c @@ -28,10 +28,10 @@ //__FBSDID("$FreeBSD: src/lib/msun/src/s_fmaxl.c,v 1.1 2004/06/30 07:04:01 das Exp $"); #include - +#include "math_private.h" #include "fpmath.h" -long double +DLLEXPORT long double fmaxl(long double x, long double y) { union IEEEl2bits u[2]; diff --git a/src/s_fmin.c b/src/s_fmin.c index bea5722..20474e6 100644 --- a/src/s_fmin.c +++ b/src/s_fmin.c @@ -28,10 +28,10 @@ //__FBSDID("$FreeBSD: src/lib/msun/src/s_fmin.c,v 1.1 2004/06/30 07:04:01 das Exp $"); #include - +#include "math_private.h" #include "fpmath.h" -double +DLLEXPORT double fmin(double x, double y) { union IEEEd2bits u[2]; diff --git a/src/s_fminf.c b/src/s_fminf.c index bcbb97c..f537186 100644 --- a/src/s_fminf.c +++ b/src/s_fminf.c @@ -28,10 +28,10 @@ //__FBSDID("$FreeBSD: src/lib/msun/src/s_fminf.c,v 1.1 2004/06/30 07:04:01 das Exp $"); #include - +#include "math_private.h" #include "fpmath.h" -float +DLLEXPORT float fminf(float x, float y) { union IEEEf2bits u[2]; diff --git a/src/s_fminl.c b/src/s_fminl.c index 94f8b52..db30e18 100644 --- a/src/s_fminl.c +++ b/src/s_fminl.c @@ -28,10 +28,10 @@ //__FBSDID("$FreeBSD: src/lib/msun/src/s_fminl.c,v 1.1 2004/06/30 07:04:01 das Exp $"); #include - +#include "math_private.h" #include "fpmath.h" -long double +DLLEXPORT long double fminl(long double x, long double y) { union IEEEl2bits u[2]; diff --git a/src/s_fpclassify.c b/src/s_fpclassify.c index 1f77597..79efb62 100644 --- a/src/s_fpclassify.c +++ b/src/s_fpclassify.c @@ -26,10 +26,10 @@ */ #include - +#include "math_private.h" #include "fpmath.h" -int +DLLEXPORT int __fpclassifyd(double d) { union IEEEd2bits u; @@ -51,7 +51,7 @@ __fpclassifyd(double d) } -int +DLLEXPORT int __fpclassifyf(float f) { union IEEEf2bits u; @@ -72,7 +72,7 @@ __fpclassifyf(float f) } } -int +DLLEXPORT int __fpclassifyl(long double e) { union IEEEl2bits u; diff --git a/src/s_frexp.c b/src/s_frexp.c index ae8d647..3a7d3bd 100644 --- a/src/s_frexp.c +++ b/src/s_frexp.c @@ -31,7 +31,7 @@ static const double two54 = 1.80143985094819840000e+16; /* 0x43500000, 0x00000000 */ -double +DLLEXPORT double frexp(double x, int *eptr) { int32_t hx, ix, lx; diff --git a/src/s_frexpf.c b/src/s_frexpf.c index b1f51cb..1f31aa1 100644 --- a/src/s_frexpf.c +++ b/src/s_frexpf.c @@ -22,7 +22,7 @@ static const float two25 = 3.3554432000e+07; /* 0x4c000000 */ -float +DLLEXPORT float frexpf(float x, int *eptr) { int32_t hx,ix; diff --git a/src/s_frexpl.c b/src/s_frexpl.c index b93ecce..c8c61f7 100644 --- a/src/s_frexpl.c +++ b/src/s_frexpl.c @@ -28,14 +28,14 @@ #include #include - +#include "math_private.h" #include "fpmath.h" #if LDBL_MAX_EXP != 0x4000 #error "Unsupported long double format" #endif -long double +DLLEXPORT long double frexpl(long double x, int *ex) { union IEEEl2bits u; diff --git a/src/s_ilogb.c b/src/s_ilogb.c index d8bc4bf..14e4265 100644 --- a/src/s_ilogb.c +++ b/src/s_ilogb.c @@ -25,7 +25,8 @@ #include "openlibm.h" #include "math_private.h" - int ilogb(double x) +DLLEXPORT int +ilogb(double x) { int32_t hx,lx,ix; diff --git a/src/s_ilogbf.c b/src/s_ilogbf.c index f7501cd..d83857c 100644 --- a/src/s_ilogbf.c +++ b/src/s_ilogbf.c @@ -21,7 +21,8 @@ #include "openlibm.h" #include "math_private.h" - int ilogbf(float x) +DLLEXPORT int +ilogbf(float x) { int32_t hx,ix; diff --git a/src/s_ilogbl.c b/src/s_ilogbl.c index f75c971..6bbe124 100644 --- a/src/s_ilogbl.c +++ b/src/s_ilogbl.c @@ -16,10 +16,10 @@ #include #include #include - +#include "math_private.h" #include "fpmath.h" -int +DLLEXPORT int ilogbl(long double x) { union IEEEl2bits u; diff --git a/src/s_isfinite.c b/src/s_isfinite.c index cb4ea17..0ae3549 100644 --- a/src/s_isfinite.c +++ b/src/s_isfinite.c @@ -27,10 +27,10 @@ */ #include - +#include "math_private.h" #include "fpmath.h" -int +DLLEXPORT int __isfinite(double d) { union IEEEd2bits u; @@ -39,7 +39,7 @@ __isfinite(double d) return (u.bits.exp != 2047); } -int +DLLEXPORT int __isfinitef(float f) { union IEEEf2bits u; @@ -48,7 +48,7 @@ __isfinitef(float f) return (u.bits.exp != 255); } -int +DLLEXPORT int __isfinitel(long double e) { union IEEEl2bits u; diff --git a/src/s_isinf.c b/src/s_isinf.c index d59d995..08c3cce 100644 --- a/src/s_isinf.c +++ b/src/s_isinf.c @@ -26,12 +26,12 @@ */ #include - +#include "math_private.h" #include "fpmath.h" /* Provided by libc */ #if 1 -int +DLLEXPORT int (isinf) (double d) { union IEEEd2bits u; @@ -41,7 +41,7 @@ int } #endif -int +DLLEXPORT int __isinff(float f) { union IEEEf2bits u; @@ -50,7 +50,7 @@ __isinff(float f) return (u.bits.exp == 255 && u.bits.man == 0); } -int +DLLEXPORT int __isinfl(long double e) { union IEEEl2bits u; diff --git a/src/s_isnan.c b/src/s_isnan.c index 7477e81..5d903e9 100644 --- a/src/s_isnan.c +++ b/src/s_isnan.c @@ -27,12 +27,12 @@ */ #include - +#include "math_private.h" #include "fpmath.h" /* Provided by libc */ #if 1 -int +DLLEXPORT int (isnan) (double d) { union IEEEd2bits u; @@ -42,7 +42,7 @@ int } #endif -int +DLLEXPORT int __isnanf(float f) { union IEEEf2bits u; @@ -51,7 +51,7 @@ __isnanf(float f) return (u.bits.exp == 255 && u.bits.man != 0); } -int +DLLEXPORT int __isnanl(long double e) { union IEEEl2bits u; diff --git a/src/s_isnormal.c b/src/s_isnormal.c index 2b624c3..bcdb86b 100644 --- a/src/s_isnormal.c +++ b/src/s_isnormal.c @@ -27,10 +27,10 @@ */ #include - +#include "math_private.h" #include "fpmath.h" -int +DLLEXPORT int __isnormal(double d) { union IEEEd2bits u; @@ -39,7 +39,7 @@ __isnormal(double d) return (u.bits.exp != 0 && u.bits.exp != 2047); } -int +DLLEXPORT int __isnormalf(float f) { union IEEEf2bits u; @@ -48,7 +48,7 @@ __isnormalf(float f) return (u.bits.exp != 0 && u.bits.exp != 255); } -int +DLLEXPORT int __isnormall(long double e) { union IEEEl2bits u; diff --git a/src/s_log1p.c b/src/s_log1p.c index 5472650..2752cd2 100644 --- a/src/s_log1p.c +++ b/src/s_log1p.c @@ -97,7 +97,7 @@ Lp7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */ static const double zero = 0.0; -double +DLLEXPORT double log1p(double x) { double hfsq,f,c,s,z,R,u; diff --git a/src/s_log1pf.c b/src/s_log1pf.c index 5f91b84..04120ea 100644 --- a/src/s_log1pf.c +++ b/src/s_log1pf.c @@ -35,7 +35,7 @@ Lp7 = 1.4798198640e-01; /* 3E178897 */ static const float zero = 0.0; -float +DLLEXPORT float log1pf(float x) { float hfsq,f,c,s,z,R,u; diff --git a/src/s_logb.c b/src/s_logb.c index 0407271..4fb376a 100644 --- a/src/s_logb.c +++ b/src/s_logb.c @@ -27,7 +27,7 @@ static const double two54 = 1.80143985094819840000e+16; /* 43500000 00000000 */ -double +DLLEXPORT double logb(double x) { int32_t lx,ix; diff --git a/src/s_logbf.c b/src/s_logbf.c index 586a917..26a36b5 100644 --- a/src/s_logbf.c +++ b/src/s_logbf.c @@ -22,7 +22,7 @@ static const float two25 = 3.355443200e+07; /* 0x4c000000 */ -float +DLLEXPORT float logbf(float x) { int32_t ix; diff --git a/src/s_logbl.c b/src/s_logbl.c index a2c2e89..44a6eab 100644 --- a/src/s_logbl.c +++ b/src/s_logbl.c @@ -13,10 +13,10 @@ #include #include #include - +#include "math_private.h" #include "fpmath.h" -long double +DLLEXPORT long double logbl(long double x) { union IEEEl2bits u; diff --git a/src/s_lrint.c b/src/s_lrint.c index 7630fca..ff7bce7 100644 --- a/src/s_lrint.c +++ b/src/s_lrint.c @@ -27,6 +27,7 @@ #include "cdefs-compat.h" #include #include +#include "math_private.h" #ifndef type //__FBSDID("$FreeBSD: src/lib/msun/src/s_lrint.c,v 1.1 2005/01/11 23:12:55 das Exp $"); @@ -43,7 +44,7 @@ * significant bits than 'type'. Hence, we bend over backwards for the * sake of correctness; an MD implementation could be more efficient. */ -dtype +DLLEXPORT dtype fn(type x) { fenv_t env; diff --git a/src/s_lround.c b/src/s_lround.c index f852ccc..f89d031 100644 --- a/src/s_lround.c +++ b/src/s_lround.c @@ -31,6 +31,7 @@ //VBS end #include #include +#include "math_private.h" #ifndef type //__FBSDID("$FreeBSD: src/lib/msun/src/s_lround.c,v 1.2 2005/04/08 00:52:16 das Exp $"); @@ -55,7 +56,7 @@ static const type dtype_max = DTYPE_MAX + 0.5; #define INRANGE(x) (dtype_max - DTYPE_MAX != 0.5 || \ ((x) > dtype_min && (x) < dtype_max)) -dtype +DLLEXPORT dtype fn(type x) { diff --git a/src/s_modf.c b/src/s_modf.c index 52ca7ba..2615729 100644 --- a/src/s_modf.c +++ b/src/s_modf.c @@ -25,7 +25,7 @@ static const double one = 1.0; -double +DLLEXPORT double modf(double x, double *iptr) { int32_t i0,i1,j0; diff --git a/src/s_modff.c b/src/s_modff.c index 9de60ff..7deee06 100644 --- a/src/s_modff.c +++ b/src/s_modff.c @@ -21,7 +21,7 @@ static const float one = 1.0; -float +DLLEXPORT float modff(float x, float *iptr) { int32_t i0,j0; diff --git a/src/s_modfl.c b/src/s_modfl.c index a5bd53d..d6d9ab6 100644 --- a/src/s_modfl.c +++ b/src/s_modfl.c @@ -38,6 +38,7 @@ #include #include +#include "math_private.h" #include #include "fpmath.h" @@ -54,7 +55,7 @@ static const long double zero[] = { 0.0L, -0.0L }; -long double +DLLEXPORT long double modfl(long double x, long double *iptr) { union IEEEl2bits ux; diff --git a/src/s_nan.c b/src/s_nan.c index c16bade..ef8aad7 100644 --- a/src/s_nan.c +++ b/src/s_nan.c @@ -61,7 +61,7 @@ static __inline int digittoint(int c) { * consider valid, so we might be violating the C standard. But it's * impossible to use nan(3) portably anyway, so this seems good enough. */ -void +DLLEXPORT void _scan_nan(u_int32_t *words, int num_words, const char *s) { int si; /* index into s */ @@ -89,7 +89,7 @@ _scan_nan(u_int32_t *words, int num_words, const char *s) } } -double +DLLEXPORT double nan(const char *s) { union { @@ -106,7 +106,7 @@ nan(const char *s) return (u.d); } -float +DLLEXPORT float nanf(const char *s) { union { diff --git a/src/s_nearbyint.c b/src/s_nearbyint.c index ea1271d..6de1d77 100644 --- a/src/s_nearbyint.c +++ b/src/s_nearbyint.c @@ -29,6 +29,7 @@ #include #include +#include "math_private.h" /* * We save and restore the floating-point environment to avoid raising @@ -38,7 +39,7 @@ * rounding can't overflow as long as emax >= p. */ #define DECL(type, fn, rint) \ -type \ +DLLEXPORT type \ fn(type x) \ { \ type ret; \ diff --git a/src/s_nextafter.c b/src/s_nextafter.c index cabdd32..f3c695e 100644 --- a/src/s_nextafter.c +++ b/src/s_nextafter.c @@ -25,7 +25,7 @@ #include "openlibm.h" #include "math_private.h" -double +DLLEXPORT double nextafter(double x, double y) { volatile double t; diff --git a/src/s_nextafterf.c b/src/s_nextafterf.c index 233a15b..1a070a6 100644 --- a/src/s_nextafterf.c +++ b/src/s_nextafterf.c @@ -19,7 +19,7 @@ #include "openlibm.h" #include "math_private.h" -float +DLLEXPORT float nextafterf(float x, float y) { volatile float t; diff --git a/src/s_nextafterl.c b/src/s_nextafterl.c index 72c5874..2874350 100644 --- a/src/s_nextafterl.c +++ b/src/s_nextafterl.c @@ -30,7 +30,7 @@ #error "Unsupported long double format" #endif -long double +DLLEXPORT long double nextafterl(long double x, long double y) { volatile long double t; diff --git a/src/s_nexttoward.c b/src/s_nexttoward.c index 6112555..eca0370 100644 --- a/src/s_nexttoward.c +++ b/src/s_nexttoward.c @@ -29,7 +29,7 @@ #error "Unsupported long double format" #endif -double +DLLEXPORT double nexttoward(double x, long double y) { union IEEEl2bits uy; diff --git a/src/s_nexttowardf.c b/src/s_nexttowardf.c index bb93378..4c1902f 100644 --- a/src/s_nexttowardf.c +++ b/src/s_nexttowardf.c @@ -20,7 +20,7 @@ #define LDBL_INFNAN_EXP (LDBL_MAX_EXP * 2 - 1) -float +DLLEXPORT float nexttowardf(float x, long double y) { union IEEEl2bits uy; diff --git a/src/s_remquo.c b/src/s_remquo.c index 85f19ab..7b63b76 100644 --- a/src/s_remquo.c +++ b/src/s_remquo.c @@ -28,7 +28,7 @@ static const double Zero[] = {0.0, -0.0,}; * method. In practice, this is far more bits than are needed to use * remquo in reduction algorithms. */ -double +DLLEXPORT double remquo(double x, double y, int *quo) { int32_t n,hx,hy,hz,ix,iy,sx,i; diff --git a/src/s_remquof.c b/src/s_remquof.c index 9d0f79a..579dec0 100644 --- a/src/s_remquof.c +++ b/src/s_remquof.c @@ -26,7 +26,7 @@ static const float Zero[] = {0.0, -0.0,}; * method. In practice, this is far more bits than are needed to use * remquo in reduction algorithms. */ -float +DLLEXPORT float remquof(float x, float y, int *quo) { int32_t n,hx,hy,hz,ix,iy,sx,i; diff --git a/src/s_remquol.c b/src/s_remquol.c index 3909d66..0100cae 100644 --- a/src/s_remquol.c +++ b/src/s_remquol.c @@ -64,7 +64,7 @@ static const long double Zero[] = {0.0L, -0.0L}; * - The high part of the mantissa fits in an int64_t with enough room * for an explicit integer bit in front of the fractional bits. */ -long double +DLLEXPORT long double remquol(long double x, long double y, int *quo) { union IEEEl2bits ux, uy; diff --git a/src/s_rint.c b/src/s_rint.c index 68abf3f..b246e00 100644 --- a/src/s_rint.c +++ b/src/s_rint.c @@ -34,7 +34,7 @@ TWO52[2]={ -4.50359962737049600000e+15, /* 0xC3300000, 0x00000000 */ }; -double +DLLEXPORT double rint(double x) { int32_t i0,j0,sx; diff --git a/src/s_rintf.c b/src/s_rintf.c index d59a92e..91d05c0 100644 --- a/src/s_rintf.c +++ b/src/s_rintf.c @@ -28,7 +28,7 @@ TWO23[2]={ -8.3886080000e+06, /* 0xcb000000 */ }; -float +DLLEXPORT float rintf(float x) { int32_t i0,j0,sx; diff --git a/src/s_rintl.c b/src/s_rintl.c index 5cef540..3dd11c2 100644 --- a/src/s_rintl.c +++ b/src/s_rintl.c @@ -55,7 +55,7 @@ shift[2] = { }; static const float zero[2] = { 0.0, -0.0 }; -long double +DLLEXPORT long double rintl(long double x) { union IEEEl2bits u; diff --git a/src/s_round.c b/src/s_round.c index b86e01c..ec758fc 100644 --- a/src/s_round.c +++ b/src/s_round.c @@ -28,8 +28,9 @@ //__FBSDID("$FreeBSD: src/lib/msun/src/s_round.c,v 1.4 2005/12/02 13:45:06 bde Exp $"); #include +#include "math_private.h" -double +DLLEXPORT double round(double x) { double t; diff --git a/src/s_roundf.c b/src/s_roundf.c index 010ac2b..cbb40f3 100644 --- a/src/s_roundf.c +++ b/src/s_roundf.c @@ -28,8 +28,9 @@ //__FBSDID("$FreeBSD: src/lib/msun/src/s_roundf.c,v 1.4 2005/12/02 13:45:06 bde Exp $"); #include +#include "math_private.h" -float +DLLEXPORT float roundf(float x) { float t; diff --git a/src/s_roundl.c b/src/s_roundl.c index fba814a..24e58aa 100644 --- a/src/s_roundl.c +++ b/src/s_roundl.c @@ -28,8 +28,9 @@ //__FBSDID("$FreeBSD: src/lib/msun/src/s_roundl.c,v 1.2 2005/12/02 13:45:06 bde Exp $"); #include +#include "math_private.h" -long double +DLLEXPORT long double roundl(long double x) { long double t; diff --git a/src/s_scalbln.c b/src/s_scalbln.c index 345f56e..ba0f699 100644 --- a/src/s_scalbln.c +++ b/src/s_scalbln.c @@ -29,8 +29,9 @@ #include #include +#include "math_private.h" -double +DLLEXPORT double scalbln (double x, long n) { int in; @@ -45,7 +46,7 @@ scalbln (double x, long n) return (scalbn(x, in)); } -float +DLLEXPORT float scalblnf (float x, long n) { int in; @@ -60,7 +61,7 @@ scalblnf (float x, long n) return (scalbnf(x, in)); } -long double +DLLEXPORT long double scalblnl (long double x, long n) { int in; diff --git a/src/s_scalbn.c b/src/s_scalbn.c index 234eabe..de2c98f 100644 --- a/src/s_scalbn.c +++ b/src/s_scalbn.c @@ -29,7 +29,7 @@ twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */ huge = 1.0e+300, tiny = 1.0e-300; -double +DLLEXPORT double scalbn (double x, int n) { int32_t k,hx,lx; diff --git a/src/s_scalbnf.c b/src/s_scalbnf.c index cf16667..e353e24 100644 --- a/src/s_scalbnf.c +++ b/src/s_scalbnf.c @@ -25,7 +25,7 @@ twom25 = 2.9802322388e-08, /* 0x33000000 */ huge = 1.0e+30, tiny = 1.0e-30; -float +DLLEXPORT float scalbnf (float x, int n) { int32_t k,ix; diff --git a/src/s_scalbnl.c b/src/s_scalbnl.c index db1563a..2b7b4fe 100644 --- a/src/s_scalbnl.c +++ b/src/s_scalbnl.c @@ -26,7 +26,7 @@ #include "cdefs-compat.h" #include #include - +#include "math_private.h" #include "fpmath.h" #if LDBL_MAX_EXP != 0x4000 @@ -37,7 +37,7 @@ static const long double huge = 0x1p16000L, tiny = 0x1p-16000L; -long double +DLLEXPORT long double scalbnl (long double x, int n) { union IEEEl2bits u; diff --git a/src/s_signbit.c b/src/s_signbit.c index b07713a..bf3463b 100644 --- a/src/s_signbit.c +++ b/src/s_signbit.c @@ -27,10 +27,10 @@ */ #include - +#include "math_private.h" #include "fpmath.h" -int +DLLEXPORT int __signbit(double d) { union IEEEd2bits u; @@ -39,7 +39,7 @@ __signbit(double d) return (u.bits.sign); } -int +DLLEXPORT int __signbitf(float f) { union IEEEf2bits u; @@ -48,7 +48,7 @@ __signbitf(float f) return (u.bits.sign); } -int +DLLEXPORT int __signbitl(long double e) { union IEEEl2bits u; diff --git a/src/s_significand.c b/src/s_significand.c index 5971716..d6d06ea 100644 --- a/src/s_significand.c +++ b/src/s_significand.c @@ -22,7 +22,7 @@ #include "openlibm.h" #include "math_private.h" -double +DLLEXPORT double significand(double x) { return __ieee754_scalb(x,(double) -ilogb(x)); diff --git a/src/s_significandf.c b/src/s_significandf.c index 1c808b4..781f786 100644 --- a/src/s_significandf.c +++ b/src/s_significandf.c @@ -19,7 +19,7 @@ #include "openlibm.h" #include "math_private.h" -float +DLLEXPORT float significandf(float x) { return __ieee754_scalbf(x,(float) -ilogbf(x)); diff --git a/src/s_sin.c b/src/s_sin.c index 3beca2b..31ed70a 100644 --- a/src/s_sin.c +++ b/src/s_sin.c @@ -51,7 +51,7 @@ #include "math_private.h" //#include "e_rem_pio2.c" -double +DLLEXPORT double sin(double x) { double y[2],z=0.0; diff --git a/src/s_sincos.c b/src/s_sincos.c index f752a71..c10a15d 100644 --- a/src/s_sincos.c +++ b/src/s_sincos.c @@ -58,7 +58,7 @@ C4 = -2.75573143513906633035e-07, /* 0xBE927E4F, 0x809C52AD */ C5 = 2.08757232129817482790e-09, /* 0x3E21EE9E, 0xBDB4B1C4 */ C6 = -1.13596475577881948265e-11; /* 0xBDA8FAE9, 0xBE8838D4 */ -void +DLLEXPORT void __kernel_sincos( double x, double y, int iy, double * k_s, double * k_c ) { /* Inline calculation of sin/cos, as we can save @@ -86,7 +86,7 @@ __kernel_sincos( double x, double y, int iy, double * k_s, double * k_c ) *k_s = x-((z*(half*y-v*r)-y)-v*S1); } -void +DLLEXPORT void sincos(double x, double * s, double * c) { double y[2]; diff --git a/src/s_sincosf.c b/src/s_sincosf.c index aaf9242..26ebca0 100644 --- a/src/s_sincosf.c +++ b/src/s_sincosf.c @@ -40,7 +40,7 @@ C1 = 0x155553e1053a42.0p-57, /* 0.0416666233237390631894 */ C2 = -0x16c087e80f1e27.0p-62, /* -0.00138867637746099294692 */ C3 = 0x199342e0ee5069.0p-68; /* 0.0000243904487962774090654 */ -void +DLLEXPORT void __kernel_sincosdf( double x, float * s, float * c ) { double r, w, z, v; @@ -62,7 +62,7 @@ __kernel_sincosdf( double x, float * s, float * c ) *s = k_s; } -void +DLLEXPORT void sincosf(float x, float * s, float * c) { // Worst approximation of sin and cos NA *s = x; @@ -159,4 +159,4 @@ sincosf(float x, float * s, float * c) { } } -} \ No newline at end of file +} diff --git a/src/s_sincosl.c b/src/s_sincosl.c index c8295d6..2ca1e97 100644 --- a/src/s_sincosl.c +++ b/src/s_sincosl.c @@ -23,9 +23,9 @@ #error "Unsupported long double format" #endif - void - sincosl( long double x, long double * s, long double * c ) - { - *s = cosl( x ); - *c = sinl( x ); - } \ No newline at end of file +DLLEXPORT void +sincosl( long double x, long double * s, long double * c ) +{ + *s = cosl( x ); + *c = sinl( x ); +} diff --git a/src/s_sinf.c b/src/s_sinf.c index 6fed17a..97a2c92 100644 --- a/src/s_sinf.c +++ b/src/s_sinf.c @@ -35,7 +35,7 @@ s2pio2 = 2*M_PI_2, /* 0x400921FB, 0x54442D18 */ s3pio2 = 3*M_PI_2, /* 0x4012D97C, 0x7F3321D2 */ s4pio2 = 4*M_PI_2; /* 0x401921FB, 0x54442D18 */ -float +DLLEXPORT float sinf(float x) { double y; diff --git a/src/s_sinl.c b/src/s_sinl.c index 5ca150a..5c73c33 100644 --- a/src/s_sinl.c +++ b/src/s_sinl.c @@ -39,7 +39,7 @@ #error "Unsupported long double format" #endif -long double +DLLEXPORT long double sinl(long double x) { union IEEEl2bits z; diff --git a/src/s_tan.c b/src/s_tan.c index 3a6fbc4..4392776 100644 --- a/src/s_tan.c +++ b/src/s_tan.c @@ -50,7 +50,7 @@ #include "math_private.h" //#include "e_rem_pio2.c" -double +DLLEXPORT double tan(double x) { double y[2],z=0.0; diff --git a/src/s_tanf.c b/src/s_tanf.c index 7c3e0f1..ccf37a9 100644 --- a/src/s_tanf.c +++ b/src/s_tanf.c @@ -33,7 +33,7 @@ t2pio2 = 2*M_PI_2, /* 0x400921FB, 0x54442D18 */ t3pio2 = 3*M_PI_2, /* 0x4012D97C, 0x7F3321D2 */ t4pio2 = 4*M_PI_2; /* 0x401921FB, 0x54442D18 */ -float +DLLEXPORT float tanf(float x) { double y; diff --git a/src/s_tanh.c b/src/s_tanh.c index cb57d92..a400fd6 100644 --- a/src/s_tanh.c +++ b/src/s_tanh.c @@ -42,7 +42,7 @@ static const double one = 1.0, two = 2.0, tiny = 1.0e-300, huge = 1.0e300; -double +DLLEXPORT double tanh(double x) { double t,z; diff --git a/src/s_tanhf.c b/src/s_tanhf.c index e752612..85b5d18 100644 --- a/src/s_tanhf.c +++ b/src/s_tanhf.c @@ -20,7 +20,7 @@ #include "math_private.h" static const float one=1.0, two=2.0, tiny = 1.0e-30, huge = 1.0e30; -float +DLLEXPORT float tanhf(float x) { float t,z; diff --git a/src/s_tanl.c b/src/s_tanl.c index 0e5b5c2..ab3046a 100644 --- a/src/s_tanl.c +++ b/src/s_tanl.c @@ -45,7 +45,7 @@ #error "Unsupported long double format" #endif -long double +DLLEXPORT long double tanl(long double x) { union IEEEl2bits z; diff --git a/src/s_tgammaf.c b/src/s_tgammaf.c index 8567686..2d37d49 100644 --- a/src/s_tgammaf.c +++ b/src/s_tgammaf.c @@ -28,6 +28,7 @@ //__FBSDID("$FreeBSD: src/lib/msun/src/s_tgammaf.c,v 1.1 2008/02/18 17:27:10 das Exp $"); #include +#include "math_private.h" /* * We simply call tgamma() rather than bloating the math library with @@ -35,7 +36,7 @@ * essentially useless, since the function is superexponential and * floats have very limited range. */ -float +DLLEXPORT float tgammaf(float x) { diff --git a/src/s_trunc.c b/src/s_trunc.c index 3289f5c..f3d56ae 100644 --- a/src/s_trunc.c +++ b/src/s_trunc.c @@ -29,7 +29,7 @@ static const double huge = 1.0e300; -double +DLLEXPORT double trunc(double x) { int32_t i0,i1,j0; diff --git a/src/s_truncf.c b/src/s_truncf.c index 34b881d..470d894 100644 --- a/src/s_truncf.c +++ b/src/s_truncf.c @@ -27,7 +27,7 @@ static const float huge = 1.0e30F; -float +DLLEXPORT float truncf(float x) { int32_t i0,j0; diff --git a/src/s_truncl.c b/src/s_truncl.c index 2c237e5..02f3c61 100644 --- a/src/s_truncl.c +++ b/src/s_truncl.c @@ -25,6 +25,7 @@ #include #include +#include "math_private.h" #include #include "fpmath.h" @@ -38,7 +39,7 @@ static const long double huge = 1.0e300; static const float zero[] = { 0.0, -0.0 }; -long double +DLLEXPORT long double truncl(long double x) { union IEEEl2bits u = { .e = x }; diff --git a/src/w_cabs.c b/src/w_cabs.c index 22f52bb..c992e4f 100644 --- a/src/w_cabs.c +++ b/src/w_cabs.c @@ -11,8 +11,9 @@ #include #include #include +#include "math_private.h" -double +DLLEXPORT double cabs(double complex z) { return hypot(creal(z), cimag(z)); diff --git a/src/w_cabsf.c b/src/w_cabsf.c index 8df96b7..20405a3 100644 --- a/src/w_cabsf.c +++ b/src/w_cabsf.c @@ -14,7 +14,7 @@ static const char rcsid[] = #include #include "math_private.h" -float +DLLEXPORT float cabsf(z) float complex z; { diff --git a/src/w_cabsl.c b/src/w_cabsl.c index c3d8fbe..7ec31b3 100644 --- a/src/w_cabsl.c +++ b/src/w_cabsl.c @@ -12,8 +12,9 @@ #include #include +#include "math_private.h" -long double +DLLEXPORT long double cabsl(long double complex z) { return hypotl(creall(z), cimagl(z)); diff --git a/src/w_drem.c b/src/w_drem.c index 010f143..8a56f63 100644 --- a/src/w_drem.c +++ b/src/w_drem.c @@ -6,8 +6,9 @@ */ #include +#include "math_private.h" -double +DLLEXPORT double drem(x, y) double x, y; { diff --git a/src/w_dremf.c b/src/w_dremf.c index 37d584a..09a76b4 100644 --- a/src/w_dremf.c +++ b/src/w_dremf.c @@ -9,7 +9,7 @@ #include "openlibm.h" #include "math_private.h" -float +DLLEXPORT float dremf(float x, float y) { return remainderf(x, y);