summaryrefslogtreecommitdiffstats
path: root/libcxx/include/fstream
diff options
context:
space:
mode:
authorShoaib Meenai <smeenai@fb.com>2016-10-31 15:09:10 +0000
committerShoaib Meenai <smeenai@fb.com>2016-10-31 15:09:10 +0000
commit73aa38dfb38f560e614664f64a650cf3a084b527 (patch)
tree46bd0aeae5a152594634749f577f3d702aefcda8 /libcxx/include/fstream
parentaa800837d3a1e649edcc4bf5121a494f887c4b60 (diff)
downloadbcm5719-llvm-73aa38dfb38f560e614664f64a650cf3a084b527.tar.gz
bcm5719-llvm-73aa38dfb38f560e614664f64a650cf3a084b527.zip
[libc++] Add configuration define for off_t functions
Create this define in __config and use it elsewhere, instead of checking the operating system/library defines in other files. The aim is to reduce the usage of _WIN32 outside __config. No functional change. Differential Revision: https://reviews.llvm.org/D25741 llvm-svn: 285582
Diffstat (limited to 'libcxx/include/fstream')
-rw-r--r--libcxx/include/fstream6
1 files changed, 3 insertions, 3 deletions
diff --git a/libcxx/include/fstream b/libcxx/include/fstream
index ce13b31c87f..b8d18aadb1c 100644
--- a/libcxx/include/fstream
+++ b/libcxx/include/fstream
@@ -813,7 +813,7 @@ basic_filebuf<_CharT, _Traits>::seekoff(off_type __off, ios_base::seekdir __way,
default:
return pos_type(off_type(-1));
}
-#if defined(_WIN32) || defined(_NEWLIB_VERSION)
+#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
if (fseek(__file_, __width > 0 ? __width * __off : 0, __whence))
return pos_type(off_type(-1));
pos_type __r = ftell(__file_);
@@ -832,7 +832,7 @@ basic_filebuf<_CharT, _Traits>::seekpos(pos_type __sp, ios_base::openmode)
{
if (__file_ == 0 || sync())
return pos_type(off_type(-1));
-#if defined(_WIN32) || defined(_NEWLIB_VERSION)
+#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
if (fseek(__file_, __sp, SEEK_SET))
return pos_type(off_type(-1));
#else
@@ -896,7 +896,7 @@ basic_filebuf<_CharT, _Traits>::sync()
}
}
}
-#if defined(_WIN32) || defined(_NEWLIB_VERSION)
+#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
if (fseek(__file_, -__c, SEEK_CUR))
return -1;
#else
OpenPOWER on IntegriCloud