]> granicus.if.org Git - llvm/commitdiff
Support: Use a 64-bit seek in raw_fd_ostream::seek().
authorPeter Collingbourne <peter@pcc.me.uk>
Fri, 9 Dec 2016 04:57:19 +0000 (04:57 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Fri, 9 Dec 2016 04:57:19 +0000 (04:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289184 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/raw_ostream.cpp

index 92c7967cd8f307eaf88b4f1beda7caaf2a9f9f40..c51f1d376b0a81bd4293dfcf2ed6ca0722536323 100644 (file)
@@ -598,7 +598,11 @@ void raw_fd_ostream::close() {
 uint64_t raw_fd_ostream::seek(uint64_t off) {
   assert(SupportsSeeking && "Stream does not support seeking!");
   flush();
-  pos = ::lseek(FD, off, SEEK_SET);
+#ifdef LLVM_ON_WIN32
+  pos = ::_lseeki64(FD, off, SEEK_SET);
+#else
+  pos = ::lseek64(FD, off, SEEK_SET);
+#endif
   if (pos == (uint64_t)-1)
     error_detected();
   return pos;