From 5ac2a538c668a13ad7d1bf2376c0442417d6f16f Mon Sep 17 00:00:00 2001
From: Brad Campbell <brad@seme.com.au>
Date: Fri, 13 Dec 2002 23:30:54 +0000
Subject: [PATCH] Added additional test for gcvt as uClibc appears to have this
 and not ecvt.

---
 configure           |  4 ++++
 configure.ac        |  2 ++
 include/config.h.in |  6 ++++++
 library/port.c      | 11 +++++------
 4 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index 0302e51f6f8..b4b878c70be 100755
--- a/configure
+++ b/configure
@@ -11644,6 +11644,8 @@ fi
 
 
 
+
+
 
 
 
@@ -11657,10 +11659,12 @@ for ac_func in \
 	chsize \
 	clone \
 	ecvt \
+	fcvt \
 	finite \
 	fpclass \
 	ftruncate \
 	ftruncate64 \
+	gcvt \
 	getnetbyaddr \
 	getnetbyname \
 	getopt_long \
diff --git a/configure.ac b/configure.ac
index b3cfe9b5283..ad433ea3fcc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -916,10 +916,12 @@ AC_CHECK_FUNCS(\
 	chsize \
 	clone \
 	ecvt \
+	fcvt \
 	finite \
 	fpclass \
 	ftruncate \
 	ftruncate64 \
+	gcvt \
 	getnetbyaddr \
 	getnetbyname \
 	getopt_long \
diff --git a/include/config.h.in b/include/config.h.in
index d5b6ee5119a..cb927f590d3 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -77,6 +77,9 @@
 /* Define to 1 if you have the <elf.h> header file. */
 #undef HAVE_ELF_H
 
+/* Define to 1 if you have the `fcvt' function. */
+#undef HAVE_FCVT
+
 /* Define to 1 if you have the `finite' function. */
 #undef HAVE_FINITE
 
@@ -122,6 +125,9 @@
 /* Define to 1 if you have the `ftruncate64' function. */
 #undef HAVE_FTRUNCATE64
 
+/* Define to 1 if you have the `gcvt' function. */
+#undef HAVE_GCVT
+
 /* Define to 1 if you have the `getbkgd' function. */
 #undef HAVE_GETBKGD
 
diff --git a/library/port.c b/library/port.c
index ddb4283223b..8033934694f 100644
--- a/library/port.c
+++ b/library/port.c
@@ -620,11 +620,6 @@ unsigned short* wine_rewrite_s4tos2(const wchar_t* str4 )
 }
 
 #ifndef HAVE_ECVT
-/*
- * NetBSD 1.5 doesn't have ecvt, fcvt, gcvt. We just check for ecvt, though.
- * Fix/verify these implementations !
- */
-
 /***********************************************************************
  *		ecvt
  */
@@ -638,7 +633,9 @@ char *ecvt (double number, int  ndigits,  int  *decpt,  int *sign)
     *decpt = (dec) ? (int)dec - (int)buf : -1;
     return buf;
 }
+#endif /* HAVE_ECVT */
 
+#ifndef HAVE_FCVT
 /***********************************************************************
  *		fcvt
  */
@@ -652,7 +649,9 @@ char *fcvt (double number, int  ndigits,  int  *decpt,  int *sign)
     *decpt = (dec) ? (int)dec - (int)buf : -1;
     return buf;
 }
+#endif /* HAVE_FCVT */
 
+#ifndef HAVE_GCVT
 /***********************************************************************
  *		gcvt
  *
@@ -663,7 +662,7 @@ char *gcvt (double number, size_t  ndigit,  char *buff)
     sprintf(buff, "%.*E", (int)ndigit, number);
     return buff;
 }
-#endif /* HAVE_ECVT */
+#endif /* HAVE_GCVT */
 
 
 #ifndef wine_memcpy_unaligned
-- 
GitLab