summaryrefslogtreecommitdiff
path: root/printf
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2002-11-09 01:58:37 +0100
committerKevin Ryde <user42@zip.com.au>2002-11-09 01:58:37 +0100
commit1054029db88b3a35c5beed34e370b85dff70fa2c (patch)
treef832be24dfc70bd52d5aaaa138fcc262ce1d52ea /printf
parent0a394175a56a1d55039ae350b73a591b6ae996cd (diff)
downloadgmp-1054029db88b3a35c5beed34e370b85dff70fa2c.tar.gz
* configure.in, Makefile.am, printf/Makefile.am,
printf/repl-vsnprintf.c: Handle vsnprintf replacement with C conditionals. And amend a couple of comments.
Diffstat (limited to 'printf')
-rw-r--r--printf/repl-vsnprintf.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/printf/repl-vsnprintf.c b/printf/repl-vsnprintf.c
index e49bf402f..debbebc17 100644
--- a/printf/repl-vsnprintf.c
+++ b/printf/repl-vsnprintf.c
@@ -24,10 +24,13 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
-#define _GNU_SOURCE /* for strnlen prototype */
-
#include "config.h"
+#if ! HAVE_VSNPRINTF /* only need this file if we don't have vsnprintf */
+
+
+#define _GNU_SOURCE /* for strnlen prototype */
+
#if HAVE_STDARG
#include <stdarg.h>
#else
@@ -35,7 +38,6 @@ MA 02111-1307, USA. */
#endif
#include <ctype.h> /* for isdigit */
-
#include <stddef.h> /* for ptrdiff_t */
#include <string.h>
#include <stdio.h> /* for NULL */
@@ -87,8 +89,8 @@ strnlen (const char *s, size_t n)
mingw32 - doesn't have vsnprintf, it seems. Because gcc is used a full
set of types are available, but "long double" is just a plain IEEE
- 64-bit "double", so we avoid the big 15-bit exponent estimate
- (LDBL_MAX_EXP_10 is defined). */
+ 64-bit "double" and LDBL_MAX_EXP_10 is correspondingly defined, so we
+ avoid the big 15-bit exponent estimate. */
int
__gmp_replacement_vsnprintf (char *buf, size_t buf_size,
@@ -125,7 +127,7 @@ __gmp_replacement_vsnprintf (char *buf, size_t buf_size,
exponent, but we don't bother trying to detect that directly. */
double_digits = 308;
#ifdef DBL_MAX_10_EXP
- /* but case prefer a value the compiler says */
+ /* but in any case prefer a value the compiler says */
double_digits = DBL_MAX_10_EXP;
#endif
@@ -385,3 +387,5 @@ __gmp_replacement_vsnprintf (char *buf, size_t buf_size,
return len;
}
+
+#endif /* ! HAVE_VSNPRINTF */