summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2016-02-21 21:20:45 -0800
committerH. Peter Anvin <hpa@zytor.com>2016-02-21 21:20:45 -0800
commitec82d7a92b6b36ee82a051ac437d5206971e179b (patch)
treedc455708102edee93fc98fd9f88a6c58d24c7124
parent73b22f5c1c8372bc5fc64962d38a75e9d6998f69 (diff)
downloadnasm-ec82d7a92b6b36ee82a051ac437d5206971e179b.tar.gz
configure: smarter way to handle fseeko() searching
Better handling of the replacement for fseeko() in its absence; also look for the Windows _fseeki64() function. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--compiler.h14
-rw-r--r--configure.in2
-rw-r--r--nasmlib.c5
3 files changed, 15 insertions, 6 deletions
diff --git a/compiler.h b/compiler.h
index 4b29d367..310e79b9 100644
--- a/compiler.h
+++ b/compiler.h
@@ -99,6 +99,20 @@ int vsnprintf(char *, size_t, const char *, va_list);
# endif
#endif
+/* Missing fseeko/ftello */
+#ifndef HAVE_FSEEKO
+# undef off_t /* Just in case it is a macro */
+# ifdef HAVE__FSEEKI64
+# define fseeko _fseeki64
+# define ftello _ftelli64
+# define off_t int64_t
+# else
+# define fseeko fseek
+# define ftello ftell
+# define off_t long
+# endif
+#endif
+
#if !defined(HAVE_STRLCPY) || !HAVE_DECL_STRLCPY
size_t strlcpy(char *, const char *, size_t);
#endif
diff --git a/configure.in b/configure.in
index 38306c2d..e05811a3 100644
--- a/configure.in
+++ b/configure.in
@@ -139,8 +139,8 @@ AC_CHECK_FUNCS(canonicalize_file_name)
AC_CHECK_FUNCS(_fullpath)
AC_CHECK_FUNCS(pathconf)
-AC_TYPE_OFF_T
AC_FUNC_FSEEKO
+AC_CHECK_FUNCS([_fseeki64])
AC_CHECK_FUNCS([ftruncate _chsize _chsize_s])
AC_CHECK_FUNCS([fileno])
diff --git a/nasmlib.c b/nasmlib.c
index eb0217d1..41da9f0e 100644
--- a/nasmlib.c
+++ b/nasmlib.c
@@ -459,11 +459,6 @@ void fwriteaddr(uint64_t data, int size, FILE * fp)
#endif
-#ifndef HAVE_FSEEKO
-# define fseeko fseek
-# define ftello ftell
-#endif
-
#ifdef HAVE_FILENO /* Useless without fileno() */
# ifdef HAVE__CHSIZE_S
# define nasm_ftruncate(fd,size) _chsize_s(fd,size)