From 5d45633f9e20472a4081e506aca854ce69bb6c7b Mon Sep 17 00:00:00 2001 From: mdw Date: Fri, 22 Jun 2001 19:35:29 +0000 Subject: [PATCH] Find out whether @@ exists (hack for uC-Linux). --- configure.in | 7 ++++++- dputf.c | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 49ebdfc..b49f494 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl -*-fundamental-*- dnl -dnl $Id: configure.in,v 1.28 2000/10/08 11:07:55 mdw Exp $ +dnl $Id: configure.in,v 1.29 2001/06/22 19:34:07 mdw Exp $ dnl dnl Configuration script for mLib dnl @@ -29,6 +29,9 @@ dnl MA 02111-1307, USA. dnl ----- Revision history -------------------------------------------------- dnl dnl $Log: configure.in,v $ +dnl Revision 1.29 2001/06/22 19:34:07 mdw +dnl Find out whether @@ exists (hack for uC-Linux). +dnl dnl Revision 1.28 2000/10/08 11:07:55 mdw dnl Define a constant to tell @mdwopt@ that @str_qword@ is available. dnl Reinstate the `-pedantic' option to GCC. @@ -82,6 +85,8 @@ AC_PROG_CC AM_PROG_LIBTOOL mdw_GCC_FLAGS +AC_CHECK_HEADERS(float.h) + mdw_CHECK_MANYLIBS(socket, socket) mdw_CHECK_MANYLIBS(gethostbyname, nsl resolv) diff --git a/dputf.c b/dputf.c index 5df210c..bb0641c 100644 --- a/dputf.c +++ b/dputf.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: dputf.c,v 1.3 2001/01/20 12:06:01 mdw Exp $ + * $Id: dputf.c,v 1.4 2001/06/22 19:35:29 mdw Exp $ * * `printf'-style formatting for dynamic strings * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: dputf.c,v $ + * Revision 1.4 2001/06/22 19:35:29 mdw + * Find out whether @@ exists (hack for uC-Linux). + * * Revision 1.3 2001/01/20 12:06:01 mdw * Define flags with macros, to ensure unsignedness. * @@ -44,13 +47,16 @@ /*----- Header files ------------------------------------------------------*/ #include -#include #include #include #include #include #include +#ifdef HAVE_FLOAT_H +# include +#endif + #include "dstr.h" /*----- Tunable constants -------------------------------------------------*/ @@ -192,6 +198,7 @@ int dstr_vputf(dstr *d, const char *p, va_list ap) goto formatted; case 'e': case 'E': case 'f': case 'F': case 'g': case 'G': +#ifdef HAVE_FLOAT_H DPUTC(&dd, *p); DPUTZ(&dd); if (*p == 'f') { @@ -213,6 +220,9 @@ int dstr_vputf(dstr *d, const char *p, va_list ap) d->len += sprintf(d->buf + d->len, dd.buf, va_arg(ap, double)); goto formatted; +#else + DPUTS(d, ""); +#endif case 'c': DPUTC(&dd, *p); -- 2.11.0