Selaa lähdekoodia

add DLLEXPORT to files in src and `int isopenlibm() = 1` function"

Jameson Nash 11 vuotta sitten
vanhempi
commit
f7c5ad7088
100 muutettua tiedostoa jossa 131 lisäystä ja 111 poistoa
  1. 1 1
      src/Make.files
  2. 4 0
      src/common.c
  3. 1 1
      src/e_acos.c
  4. 1 1
      src/e_acosf.c
  5. 1 1
      src/e_acosh.c
  6. 1 1
      src/e_acoshf.c
  7. 1 1
      src/e_acosl.c
  8. 1 1
      src/e_asin.c
  9. 1 1
      src/e_asinf.c
  10. 1 1
      src/e_asinl.c
  11. 1 1
      src/e_atan2.c
  12. 1 1
      src/e_atan2f.c
  13. 1 1
      src/e_atan2l.c
  14. 1 1
      src/e_atanh.c
  15. 1 1
      src/e_atanhf.c
  16. 1 1
      src/e_cosh.c
  17. 1 1
      src/e_coshf.c
  18. 1 1
      src/e_exp.c
  19. 1 1
      src/e_expf.c
  20. 1 1
      src/e_fmod.c
  21. 1 1
      src/e_fmodf.c
  22. 1 1
      src/e_fmodl.c
  23. 1 1
      src/e_gamma.c
  24. 1 1
      src/e_gamma_r.c
  25. 1 1
      src/e_gammaf.c
  26. 1 1
      src/e_gammaf_r.c
  27. 1 1
      src/e_hypot.c
  28. 1 1
      src/e_hypotf.c
  29. 1 1
      src/e_hypotl.c
  30. 2 2
      src/e_j0.c
  31. 2 2
      src/e_j0f.c
  32. 2 2
      src/e_j1.c
  33. 2 2
      src/e_j1f.c
  34. 2 2
      src/e_jn.c
  35. 2 2
      src/e_jnf.c
  36. 1 1
      src/e_lgamma.c
  37. 1 1
      src/e_lgamma_r.c
  38. 1 1
      src/e_lgammaf.c
  39. 1 1
      src/e_lgammaf_r.c
  40. 1 1
      src/e_log.c
  41. 1 1
      src/e_log10.c
  42. 1 1
      src/e_log10f.c
  43. 1 1
      src/e_log2.c
  44. 1 1
      src/e_log2f.c
  45. 1 1
      src/e_logf.c
  46. 1 1
      src/e_pow.c
  47. 1 1
      src/e_powf.c
  48. 1 1
      src/e_rem_pio2.c
  49. 1 1
      src/e_rem_pio2f.c
  50. 1 1
      src/e_remainder.c
  51. 1 1
      src/e_remainderf.c
  52. 2 1
      src/e_remainderl.c
  53. 2 2
      src/e_scalb.c
  54. 2 2
      src/e_scalbf.c
  55. 1 1
      src/e_sinh.c
  56. 1 1
      src/e_sinhf.c
  57. 1 1
      src/e_sqrt.c
  58. 1 1
      src/e_sqrtf.c
  59. 2 1
      src/e_sqrtl.c
  60. 1 1
      src/k_cos.c
  61. 1 1
      src/k_cosf.c
  62. 2 2
      src/k_exp.c
  63. 2 2
      src/k_expf.c
  64. 1 1
      src/k_rem_pio2.c
  65. 1 1
      src/k_sin.c
  66. 1 1
      src/k_sinf.c
  67. 1 1
      src/k_tan.c
  68. 1 1
      src/k_tanf.c
  69. 10 0
      src/math_private.h
  70. 1 1
      src/s_asinh.c
  71. 1 1
      src/s_asinhf.c
  72. 1 1
      src/s_atan.c
  73. 1 1
      src/s_atanf.c
  74. 1 1
      src/s_atanl.c
  75. 2 1
      src/s_carg.c
  76. 2 1
      src/s_cargf.c
  77. 2 1
      src/s_cargl.c
  78. 1 1
      src/s_cbrt.c
  79. 1 1
      src/s_cbrtf.c
  80. 1 1
      src/s_cbrtl.c
  81. 2 2
      src/s_ccosh.c
  82. 2 2
      src/s_ccoshf.c
  83. 1 1
      src/s_ceil.c
  84. 1 1
      src/s_ceilf.c
  85. 1 1
      src/s_ceill.c
  86. 1 1
      src/s_cexp.c
  87. 1 1
      src/s_cexpf.c
  88. 1 1
      src/s_cimag.c
  89. 1 1
      src/s_cimagf.c
  90. 1 1
      src/s_cimagl.c
  91. 1 1
      src/s_conj.c
  92. 1 1
      src/s_conjf.c
  93. 1 1
      src/s_conjl.c
  94. 1 1
      src/s_copysign.c
  95. 1 1
      src/s_copysignf.c
  96. 2 2
      src/s_copysignl.c
  97. 1 1
      src/s_cos.c
  98. 1 1
      src/s_cosf.c
  99. 1 1
      src/s_cosl.c
  100. 2 1
      src/s_cpow.c

+ 1 - 1
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 \

+ 4 - 0
src/common.c

@@ -0,0 +1,4 @@
+#include "math_private.h"
+DLLEXPORT int isopenlibm() {
+    return 1;
+}

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
src/e_gamma.c

@@ -26,7 +26,7 @@
 
 extern int signgam;
 
-double
+DLLEXPORT double
 __ieee754_gamma(double x)
 {
 	return __ieee754_gamma_r(x,&signgam);

+ 1 - 1
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);

+ 1 - 1
src/e_gammaf.c

@@ -27,7 +27,7 @@
 
 extern int signgam;
 
-float
+DLLEXPORT float
 __ieee754_gammaf(float x)
 {
 	return __ieee754_gammaf_r(x,&signgam);

+ 1 - 1
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);

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 2 - 2
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;

+ 2 - 2
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;

+ 2 - 2
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;

+ 2 - 2
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;

+ 2 - 2
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;

+ 2 - 2
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;

+ 1 - 1
src/e_lgamma.c

@@ -26,7 +26,7 @@
 
 extern int signgam;
 
-double
+DLLEXPORT double
 __ieee754_lgamma(double x)
 {
 	return __ieee754_lgamma_r(x,&signgam);

+ 1 - 1
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;

+ 1 - 1
src/e_lgammaf.c

@@ -27,7 +27,7 @@
 
 extern int signgam;
 
-float
+DLLEXPORT float
 __ieee754_lgammaf(float x)
 {
 	return __ieee754_lgammaf_r(x,&signgam);

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 2 - 1
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 <openlibm.h>
+#include "math_private.h"
 
-long double
+DLLEXPORT long double
 remainderl(long double x, long double y)
 {
 	int quo;

+ 2 - 2
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
 {

+ 2 - 2
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
 {

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 2 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 2 - 2
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;

+ 2 - 2
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 10 - 0
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_ */

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 2 - 1
src/s_carg.c

@@ -29,8 +29,9 @@
 
 #include <complex.h>
 #include <openlibm.h>
+#include "math_private.h"
 
-double
+DLLEXPORT double
 carg(double complex z)
 {
 

+ 2 - 1
src/s_cargf.c

@@ -29,8 +29,9 @@
 
 #include <complex.h>
 #include <openlibm.h>
+#include "math_private.h"
 
-float
+DLLEXPORT float
 cargf(float complex z)
 {
 

+ 2 - 1
src/s_cargl.c

@@ -29,8 +29,9 @@
 
 #include <complex.h>
 #include <openlibm.h>
+#include "math_private.h"
 
-long double
+DLLEXPORT long double
 cargl(long double complex z)
 {
 

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 2 - 2
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)
 {
 

+ 2 - 2
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)
 {
 

+ 1 - 1
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;

+ 1 - 1
src/s_ceilf.c

@@ -21,7 +21,7 @@
 
 static const float huge = 1.0e30;
 
-float
+DLLEXPORT float
 ceilf(float x)
 {
 	int32_t i0,j0;

+ 1 - 1
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 };

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
src/s_cimag.c

@@ -29,7 +29,7 @@
 #include <complex.h>
 #include "math_private.h"
 
-double
+DLLEXPORT double
 cimag(double complex z)
 {
 	const double_complex z1 = { .f = z };

+ 1 - 1
src/s_cimagf.c

@@ -29,7 +29,7 @@
 #include <complex.h>
 #include "math_private.h"
 
-float
+DLLEXPORT float
 cimagf(float complex z)
 {
 	const float_complex z1 = { .f = z };

+ 1 - 1
src/s_cimagl.c

@@ -29,7 +29,7 @@
 #include <complex.h>
 #include "math_private.h"
 
-long double
+DLLEXPORT long double
 cimagl(long double complex z)
 {
 	const long_double_complex z1 = { .f = z };

+ 1 - 1
src/s_conj.c

@@ -30,7 +30,7 @@
 
 #include "math_private.h"
 
-double complex
+DLLEXPORT double complex
 conj(double complex z)
 {
 

+ 1 - 1
src/s_conjf.c

@@ -30,7 +30,7 @@
 
 #include "math_private.h"
 
-float complex
+DLLEXPORT float complex
 conjf(float complex z)
 {
 

+ 1 - 1
src/s_conjl.c

@@ -30,7 +30,7 @@
 
 #include "math_private.h"
 
-long double complex
+DLLEXPORT long double complex
 conjl(long double complex z)
 {
 

+ 1 - 1
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;

+ 1 - 1
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;

+ 2 - 2
src/s_copysignl.c

@@ -27,10 +27,10 @@
  */
 
 #include <openlibm.h>
-
+#include "math_private.h"
 #include "fpmath.h"
 
-long double
+DLLEXPORT long double
 copysignl(long double x, long double y)
 {
 	union IEEEl2bits ux, uy;

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 2 - 1
src/s_cpow.c

@@ -47,8 +47,9 @@
 #include <complex.h>
 #include <float.h>
 #include <openlibm.h>
+#include "math_private.h"
 
-double complex
+DLLEXPORT double complex
 cpow(double complex a, double complex z)
 {
 	double complex w;

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä