[prev in list] [next in list] [prev in thread] [next in thread]
List: apr-cvs
Subject: cvs commit: apr/strings apr_snprintf.c
From: trawick () apache ! org
Date: 2001-04-27 18:36:09
[Download RAW message or body]
trawick 01/04/27 11:36:09
Modified: . configure.in
strings apr_snprintf.c
Log:
Get apr_snprintf() compiling again on platforms without isnan() or
isinf(). (Such platforms include Solaris and OS/390.)
Submitted by: Justin Erenkrantz <jerenkrantz@ebuilt.com>
Revision Changes Path
1.294 +1 -1 apr/configure.in
Index: configure.in
===================================================================
RCS file: /home/cvs/apr/configure.in,v
retrieving revision 1.293
retrieving revision 1.294
diff -u -r1.293 -r1.294
--- configure.in 2001/04/19 07:18:39 1.293
+++ configure.in 2001/04/27 18:36:03 1.294
@@ -390,7 +390,7 @@
dnl #----------------------------- Checks for Any required Functions
dnl Checks for library functions. (N.B. poll is further down)
-AC_CHECK_FUNCS(strcasecmp stricmp setsid nl_langinfo)
+AC_CHECK_FUNCS(strcasecmp stricmp setsid nl_langinfo isinf isnan)
AC_CHECK_FUNCS(setrlimit, [ have_setrlimit="1" ], [ have_setrlimit="0" ])
AC_CHECK_FUNCS(getrlimit, [ have_getrlimit="1" ], [ have_getrlimit="0" ])
AC_CHECK_FUNCS(writev)
1.14 +8 -3 apr/strings/apr_snprintf.c
Index: apr_snprintf.c
===================================================================
RCS file: /home/cvs/apr/strings/apr_snprintf.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- apr_snprintf.c 2001/04/27 13:01:59 1.13
+++ apr_snprintf.c 2001/04/27 18:36:06 1.14
@@ -952,17 +952,22 @@
case 'E':
fp_num = va_arg(ap, double);
/*
- * * We use &num_buf[ 1 ], so that we have room for the sign
+ * We use &num_buf[ 1 ], so that we have room for the sign
*/
+ s = NULL;
+#ifdef HAVE_ISNAN
if (isnan(fp_num)) {
s = "nan";
s_len = 3;
}
- else if (isinf(fp_num)) {
+#endif
+#ifdef HAVE_ISINF
+ if (!s && isinf(fp_num)) {
s = "inf";
s_len = 3;
}
- else {
+#endif
+ if (!s) {
s = conv_fp(*fmt, fp_num, alternate_form,
(adjust_precision == NO) ? FLOAT_DIGITS : precision,
&is_negative, &num_buf[1], &s_len);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic