summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea/win32lib.c
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2013-06-24 22:48:43 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2013-06-24 22:48:43 +0000
commit04ce8d1155f2fd81d8519f3156e5b8345a1412a5 (patch)
treed168232ea4895819fdb41c46de7dc15ba68375f8 /Build/source/texk/kpathsea/win32lib.c
parent46641b6545659d40a665d64d0e7239bed2235c73 (diff)
unify two win32lib.c's in w32 sources.
git-svn-id: svn://tug.org/texlive/trunk@30906 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/win32lib.c')
-rw-r--r--Build/source/texk/kpathsea/win32lib.c12
1 files changed, 12 insertions, 0 deletions
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
}