/* Define to 1 if you have the `strndup' function. */
#undef HAVE_STRNDUP
+/* Define to 1 if you have the `strtof' function. */
+#undef HAVE_STRTOF
+
/* Define to 1 if you have the `strtoul' function. */
#undef HAVE_STRTOUL
-for ac_func in mmap strerror strndup strtoul mbrtowc mkstemp getopt_long utimes utime wcwidth snprintf vsnprintf
+
+for ac_func in mmap strerror strndup strtoul mbrtowc mkstemp getopt_long utimes utime wcwidth snprintf vsnprintf strtof
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
AC_CHECK_SIZEOF_STDC_HEADERS(uint64_t, 0)
dnl Checks for functions
-AC_CHECK_FUNCS(mmap strerror strndup strtoul mbrtowc mkstemp getopt_long utimes utime wcwidth snprintf vsnprintf)
+AC_CHECK_FUNCS(mmap strerror strndup strtoul mbrtowc mkstemp getopt_long utimes utime wcwidth snprintf vsnprintf strtof)
dnl Checks for libraries
AC_CHECK_LIB(z,gzopen)
#include "file.h"
#include "magic.h"
+#include "patchlevel.h"
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifndef lint
-FILE_RCSID("@(#)$File: apprentice.c,v 1.107 2007/11/08 00:31:37 christos Exp $")
+FILE_RCSID("@(#)$File: apprentice.c,v 1.108 2007/12/27 16:35:58 christos Exp $")
#endif /* lint */
#define EATAB {while (isascii((unsigned char) *l) && \
case FILE_LEFLOAT:
if (m->reln != 'x') {
char *ep;
+#ifdef HAVE_STRTOF
m->value.f = strtof(*p, &ep);
+#else
+ m->value.f = (float)strtod(*p, &ep);
+#endif
*p = ep;
}
return 0;
else
version = ptr[1];
if (version != VERSIONNO) {
- file_error(ms, 0, "version mismatch (%d != %d) in `%s'",
- version, VERSIONNO, dbname);
+ file_error(ms, 0, "File %d.%d supports only %d version magic "
+ "files. `%s' is version %d", FILE_VERSION_MAJOR, patchlevel,
+ VERSIONNO, dbname, version);
goto error;
}
*nmagicp = (uint32_t)(st.st_size / sizeof(struct magic)) - 1;