The ucrt math functions are C99 compliant, and should in general
be usable.

Move such symbols from src_libmingwex to src_msvcrt_common. By not
having them in libmingwex, the corresponding imported functions from
libucrtbase.a/libucrt.a will be preferred instead.

First do this for source files that are handled identically for all
architectures.

Signed-off-by: Martin Storsjö <mar...@martin.st>
---
 mingw-w64-crt/Makefile.am                     | 50 +++++++++++--------
 .../api-ms-win-crt-math-l1-1-0.def.in         |  6 +--
 mingw-w64-crt/lib-common/ucrtbase.def.in      |  6 +--
 3 files changed, 35 insertions(+), 27 deletions(-)

diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 5f46703bb..eb1c2aa1d 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -173,7 +173,25 @@ src_msvcrt_common=\
   stdio/strtof.c \
   stdio/snprintf_alias.c \
   stdio/vsnprintf_alias.c \
-  math/frexp.c
+  math/cbrt.c math/cbrtf.c \
+  math/copysign.c math/copysignf.c \
+  math/fabs.c \
+  math/fdim.c math/fdimf.c \
+  math/fma.c math/fmaf.c \
+  math/fmax.c math/fmaxf.c \
+  math/fmin.c math/fminf.c \
+  math/frexp.c \
+  math/hypot.c \
+  math/llrint.c math/llrintf.c \
+  math/llround.c math/llroundf.c \
+  math/lrint.c math/lrintf.c \
+  math/lround.c math/lroundf.c \
+  math/modf.c \
+  math/nextafterf.c \
+  math/round.c math/roundf.c \
+  math/s_erf.c math/sf_erf.c \
+  math/sqrt.c \
+  math/tgamma.c math/tgammaf.c
 
 src_msvcrt=\
   misc/_configthreadlocale.c \
@@ -539,28 +557,18 @@ src_libmingwex=\
   gdtoa/misc.c      gdtoa/qnan.c     gdtoa/smisc.c  gdtoa/strtodg.c  
gdtoa/strtodnrp.c  gdtoa/strtof.c     \
   gdtoa/strtopx.c   gdtoa/sum.c      gdtoa/ulp.c    \
   \
-  math/cbrt.c           \
-  math/cbrtf.c          math/cbrtl.c       math/copysign.c      
math/copysignf.c     \
-  math/coshf.c          math/coshl.c       math/erfl.c           \
-  math/expf.c           \
-  math/fabs.c           math/fabsf.c       math/fabsl.c          math/fdim.c   
       math/fdimf.c         math/fdiml.c         \
-  math/fma.c            math/fmaf.c        math/fmal.c           \
-  math/fmax.c           math/fmaxf.c       math/fmaxl.c          math/fmin.c   
       math/fminf.c         \
-  math/fminl.c          math/fp_consts.c   math/fp_constsf.c     \
+  math/cbrtl.c          math/coshf.c       math/coshl.c          math/erfl.c   
       \
+  math/expf.c           math/fabsf.c       math/fabsl.c          math/fdiml.c  
       math/fmal.c          \
+  math/fmaxl.c          math/fminl.c       math/fp_consts.c      
math/fp_constsf.c    \
   math/fp_constsl.c     math/fpclassify.c  math/fpclassifyf.c    
math/fpclassifyl.c   math/frexpf.c        math/frexpl.c \
-  math/hypotf.c         math/hypot.c  math/hypotl.c      math/isnan.c          
math/isnanf.c        math/isnanl.c        \
-  math/ldexpf.c         math/lgamma.c      math/lgammaf.c        
math/lgammal.c       math/llrint.c        \
-  math/signgam.c \
-  math/llrintf.c        math/llrintl.c     math/llround.c        
math/llroundf.c      math/llroundl.c      \
-  math/log10f.c         math/logf.c        \
-  math/lrint.c          math/lrintf.c      math/lrintl.c         math/lround.c 
       math/lroundf.c       math/lroundl.c       \
-  math/modf.c           math/modff.c       math/modfl.c          
math/nextafterf.c    math/nextafterl.c    math/nexttoward.c    \
+  math/hypotf.c         math/hypotl.c      math/isnan.c          math/isnanf.c 
       math/isnanl.c        \
+  math/ldexpf.c         math/lgamma.c      math/lgammaf.c        
math/lgammal.c       math/llrintl.c       \
+  math/llroundl.c       math/log10f.c      math/logf.c           math/lrintl.c 
       math/lroundl.c       \
+  math/modff.c          math/modfl.c       math/nextafterl.c     
math/nexttoward.c    \
   math/nexttowardf.c    math/powf.c        math/powi.c           math/powif.c  
       math/powil.c         \
-  math/rintl.c          math/round.c       math/roundf.c         \
-  math/roundl.c         math/s_erf.c       math/sf_erf.c         
math/signbit.c       math/signbitf.c      math/signbitl.c      \
-  math/sinhf.c          math/sinhl.c       math/sqrt.c           \
-  math/sqrtf.c          math/sqrtl.c       math/tanhf.c          math/tanhl.c  
       math/tgamma.c        \
-  math/tgammaf.c        math/tgammal.c     math/truncl.c         \
+  math/rintl.c          math/roundl.c      math/signbit.c        
math/signbitf.c      math/signbitl.c      \
+  math/signgam.c        math/sinhf.c       math/sinhl.c          math/sqrtf.c  
       math/sqrtl.c         \
+  math/tanhf.c          math/tanhl.c       math/tgammal.c        math/truncl.c 
       \
   math/powi.def.h       math/sqrt.def.h       \
   math/cephes_mconf.h   math/fp_consts.h   \
   \
diff --git a/mingw-w64-crt/lib-common/api-ms-win-crt-math-l1-1-0.def.in 
b/mingw-w64-crt/lib-common/api-ms-win-crt-math-l1-1-0.def.in
index e01fb0520..dfac503b1 100644
--- a/mingw-w64-crt/lib-common/api-ms-win-crt-math-l1-1-0.def.in
+++ b/mingw-w64-crt/lib-common/api-ms-win-crt-math-l1-1-0.def.in
@@ -264,7 +264,7 @@ F_ARM_ANY(expl == exp)
 expm1
 expm1f
 expm1l F_X86_ANY(DATA)
-fabs DATA
+fabs
 F_ARM_ANY(fabsf)
 fdim
 fdimf
@@ -322,7 +322,7 @@ lrintl F_X86_ANY(DATA)
 lround
 lroundf
 lroundl F_X86_ANY(DATA)
-modf DATA
+modf
 F_NON_I386(modff DATA)
 nan
 nanf
@@ -368,7 +368,7 @@ F_ARM_ANY(sinl == sin)
 ; if we implement sinh, we can set it DATA only.
 sinh
 F_NON_I386(sinhf DATA)
-sqrt DATA
+sqrt
 F_NON_I386(sqrtf DATA)
 tan
 F_NON_I386(tanf F_X86_ANY(DATA))
diff --git a/mingw-w64-crt/lib-common/ucrtbase.def.in 
b/mingw-w64-crt/lib-common/ucrtbase.def.in
index 0b83b04e7..a9a7d8215 100644
--- a/mingw-w64-crt/lib-common/ucrtbase.def.in
+++ b/mingw-w64-crt/lib-common/ucrtbase.def.in
@@ -2315,7 +2315,7 @@ F_ARM_ANY(expl == exp)
 expm1
 expm1f
 expm1l F_X86_ANY(DATA)
-fabs DATA
+fabs
 F_ARM_ANY(fabsf)
 fclose
 fdim
@@ -2471,7 +2471,7 @@ memcpy_s
 memmove
 memmove_s
 memset
-modf DATA
+modf
 F_NON_I386(modff DATA)
 nan
 nanf
@@ -2540,7 +2540,7 @@ F_ARM_ANY(sinl == sin)
 ; if we implement sinh, we can set it DATA only.
 sinh
 F_NON_I386(sinhf DATA)
-sqrt DATA
+sqrt
 F_NON_I386(sqrtf DATA)
 srand
 strcat
-- 
2.34.1



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to