From a31036a30ec3d67f59cc9733537d40a652697a8c Mon Sep 17 00:00:00 2001 From: Peter Avalos Date: Sun, 21 Jun 2009 08:07:22 +0000 Subject: [PATCH] Allow pre-2.3 systems to build the new version of file. Add a few things under COMPILE_ONLY so systems without strtof and/or daylight can still build the host tool. --- contrib/file/src/apprentice.c | 2 +- contrib/file/src/print.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/file/src/apprentice.c b/contrib/file/src/apprentice.c index aa6a41c9fd..f3df21fa01 100644 --- a/contrib/file/src/apprentice.c +++ b/contrib/file/src/apprentice.c @@ -1763,7 +1763,7 @@ getvalue(struct magic_set *ms, struct magic *m, const char **p, int action) case FILE_LEFLOAT: if (m->reln != 'x') { char *ep; -#ifdef HAVE_STRTOF +#if defined(HAVE_STRTOF) && !defined(COMPILE_ONLY) m->value.f = strtof(*p, &ep); #else m->value.f = (float)strtod(*p, &ep); diff --git a/contrib/file/src/print.c b/contrib/file/src/print.c index d44a5b3b1b..9dc79639d0 100644 --- a/contrib/file/src/print.c +++ b/contrib/file/src/print.c @@ -198,6 +198,7 @@ file_magwarn(struct magic_set *ms, const char *f, ...) (void) fputc('\n', stderr); } +#ifndef COMPILE_ONLY protected const char * file_fmttime(uint32_t v, int local) { @@ -234,3 +235,4 @@ file_fmttime(uint32_t v, int local) pp[strcspn(pp, "\n")] = '\0'; return pp; } +#endif -- 2.11.4.GIT