summaryrefslogtreecommitdiff
path: root/klm/util/file.cc
diff options
context:
space:
mode:
authorKenneth Heafield <github@kheafield.com>2012-09-11 14:23:39 +0100
committerKenneth Heafield <github@kheafield.com>2012-09-11 14:27:52 +0100
commit8882e9ebe158aef382bb5544559ef7f2a553db62 (patch)
treef0ed595a45df16ddd1ca7ba61bc4ac0ee22d2dfb /klm/util/file.cc
parent104e23dd0b0795abab4565228537438481dc5a5b (diff)
Update kenlm and build system
Diffstat (limited to 'klm/util/file.cc')
-rw-r--r--klm/util/file.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/klm/util/file.cc b/klm/util/file.cc
index 98f13983..ff5e64c9 100644
--- a/klm/util/file.cc
+++ b/klm/util/file.cc
@@ -119,8 +119,13 @@ void FSyncOrThrow(int fd) {
}
namespace {
-void InternalSeek(int fd, off_t off, int whence) {
+void InternalSeek(int fd, int64_t off, int whence) {
+#if defined(_WIN32) || defined(_WIN64)
+ UTIL_THROW_IF((__int64)-1 == _lseeki64(fd, off, whence), ErrnoException, "Windows seek failed");
+
+#else
UTIL_THROW_IF((off_t)-1 == lseek(fd, off, whence), ErrnoException, "Seek failed");
+#endif
}
} // namespace