aboutsummaryrefslogtreecommitdiff
path: root/system/include/libcxx/fstream
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-08-08 19:57:52 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-08-08 19:57:52 -0700
commit5bc9fceed3002e0b24a3510f12779fc1243c4c07 (patch)
tree3ace3d12e614e27cece95fad1eef96bae0d52409 /system/include/libcxx/fstream
parent6c275bebb45d6aac7e4a024b825ab34971b178d2 (diff)
parent32b77e92823f0cd6837b85f3c6208715fb0e757b (diff)
Merge pull request #1480 from waywardmonkeys/update-libcxx-part-20
Update libcxx
Diffstat (limited to 'system/include/libcxx/fstream')
-rw-r--r--system/include/libcxx/fstream16
1 files changed, 16 insertions, 0 deletions
diff --git a/system/include/libcxx/fstream b/system/include/libcxx/fstream
index 0a5cf92a..e3f8306f 100644
--- a/system/include/libcxx/fstream
+++ b/system/include/libcxx/fstream
@@ -807,9 +807,15 @@ basic_filebuf<_CharT, _Traits>::seekoff(off_type __off, ios_base::seekdir __way,
default:
return pos_type(off_type(-1));
}
+#if _WIN32
+ if (fseek(__file_, __width > 0 ? __width * __off : 0, __whence))
+ return pos_type(off_type(-1));
+ pos_type __r = ftell(__file_);
+#else
if (fseeko(__file_, __width > 0 ? __width * __off : 0, __whence))
return pos_type(off_type(-1));
pos_type __r = ftello(__file_);
+#endif
__r.state(__st_);
return __r;
}
@@ -820,8 +826,13 @@ basic_filebuf<_CharT, _Traits>::seekpos(pos_type __sp, ios_base::openmode)
{
if (__file_ == 0 || sync())
return pos_type(off_type(-1));
+#if _WIN32
+ if (fseek(__file_, __sp, SEEK_SET))
+ return pos_type(off_type(-1));
+#else
if (fseeko(__file_, __sp, SEEK_SET))
return pos_type(off_type(-1));
+#endif
__st_ = __sp.state();
return __sp;
}
@@ -880,8 +891,13 @@ basic_filebuf<_CharT, _Traits>::sync()
}
}
}
+#if _WIN32
+ if (fseek(__file_, -__c, SEEK_CUR))
+ return -1;
+#else
if (fseeko(__file_, -__c, SEEK_CUR))
return -1;
+#endif
if (__update_st)
__st_ = __state;
__extbufnext_ = __extbufend_ = __extbuf_;