From 04ce8d1155f2fd81d8519f3156e5b8345a1412a5 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Mon, 24 Jun 2013 22:48:43 +0000 Subject: unify two win32lib.c's in w32 sources. git-svn-id: svn://tug.org/texlive/trunk@30906 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/kpathsea/win32lib.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Build/source/texk/kpathsea/win32lib.c') diff --git a/Build/source/texk/kpathsea/win32lib.c b/Build/source/texk/kpathsea/win32lib.c index c25fdfd931c..0f1d353b745 100644 --- a/Build/source/texk/kpathsea/win32lib.c +++ b/Build/source/texk/kpathsea/win32lib.c @@ -42,6 +42,12 @@ int win32_pclose (FILE *f) __int64 xftell64 (FILE *f, const char *filename) { +#if _MSC_VER > 1200 + __int64 where; + where = _ftelli64(f); + if (where < (__int64)0) + FATAL_PERROR(filename); +#else __int64 where, filepos; int fd; @@ -56,12 +62,17 @@ xftell64 (FILE *f, const char *filename) where = (__int64)(f->_ptr - f->_base); else where = filepos - f->_cnt; +#endif return where; } void xfseek64 (FILE *f, __int64 offset, int wherefrom, const char *filename) { +#if _MSC_VER > 1200 + if (_fseeki64(f, offset, wherefrom) < (__int64)0) + FATAL_PERROR(filename); +#else if(wherefrom == SEEK_CUR) { offset += xftell64(f, filename); wherefrom = SEEK_SET; @@ -69,6 +80,7 @@ xfseek64 (FILE *f, __int64 offset, int wherefrom, const char *filename) fflush(f); if (_lseeki64(fileno(f), offset, wherefrom) < (__int64)0) FATAL_PERROR(filename); +#endif } -- cgit v1.2.3