~mdw
/
mLib
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Include @<ctype.h>@.
[mLib]
/
dputf.c
diff --git
a/dputf.c
b/dputf.c
index
5df210c
..
bb0641c
100644
(file)
--- a/
dputf.c
+++ b/
dputf.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-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
*
*
* `printf'-style formatting for dynamic strings
*
@@
-30,6
+30,9
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: dputf.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: dputf.c,v $
+ * Revision 1.4 2001/06/22 19:35:29 mdw
+ * Find out whether @<float.h>@ exists (hack for uC-Linux).
+ *
* Revision 1.3 2001/01/20 12:06:01 mdw
* Define flags with macros, to ensure unsignedness.
*
* Revision 1.3 2001/01/20 12:06:01 mdw
* Define flags with macros, to ensure unsignedness.
*
@@
-44,13
+47,16
@@
/*----- Header files ------------------------------------------------------*/
#include <ctype.h>
/*----- Header files ------------------------------------------------------*/
#include <ctype.h>
-#include <float.h>
#include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_FLOAT_H
+# include <float.h>
+#endif
+
#include "dstr.h"
/*----- Tunable constants -------------------------------------------------*/
#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':
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') {
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;
d->len += sprintf(d->buf + d->len, dd.buf,
va_arg(ap, double));
goto formatted;
+#else
+ DPUTS(d, "<no float support>");
+#endif
case 'c':
DPUTC(&dd, *p);
case 'c':
DPUTC(&dd, *p);