Use more correct file offset type

This commit is contained in:
Dmitry Marakasov 2016-01-05 17:47:12 +03:00
parent 6000d16548
commit f0dd37f428

View File

@ -1,6 +1,6 @@
/* /*
libSDL2pp - C++11 bindings/wrapper for SDL2 libSDL2pp - C++11 bindings/wrapper for SDL2
Copyright (C) 2014-2015 Dmitry Marakasov <amdmi3@amdmi3.ru> Copyright (C) 2014-2016 Dmitry Marakasov <amdmi3@amdmi3.ru>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
@ -57,22 +57,22 @@ protected:
private: private:
template <class SS> template <class SS>
typename std::enable_if<std::is_base_of<std::istream, SS>::value && !std::is_base_of<std::ostream, SS>::value, void>::type SeekHelper(off_t off, std::ios_base::seekdir dir) { typename std::enable_if<std::is_base_of<std::istream, SS>::value && !std::is_base_of<std::ostream, SS>::value, void>::type SeekHelper(typename SS::off_type off, std::ios_base::seekdir dir) {
stream_.seekg(off, dir); stream_.seekg(off, dir);
} }
template <class SS> template <class SS>
typename std::enable_if<!std::is_base_of<std::istream, SS>::value && std::is_base_of<std::ostream, SS>::value, void>::type SeekHelper(off_t off, std::ios_base::seekdir dir) { typename std::enable_if<!std::is_base_of<std::istream, SS>::value && std::is_base_of<std::ostream, SS>::value, void>::type SeekHelper(typename SS::off_type off, std::ios_base::seekdir dir) {
stream_.seekp(off, dir); stream_.seekp(off, dir);
} }
template <class SS> template <class SS>
typename std::enable_if<std::is_base_of<std::istream, SS>::value && !std::is_base_of<std::ostream, SS>::value, off_t>::type TellHelper() { typename std::enable_if<std::is_base_of<std::istream, SS>::value && !std::is_base_of<std::ostream, SS>::value, typename SS::off_type>::type TellHelper() {
return stream_.tellg(); return stream_.tellg();
} }
template <class SS> template <class SS>
typename std::enable_if<!std::is_base_of<std::istream, SS>::value && std::is_base_of<std::ostream, SS>::value, off_t>::type TellHelper() { typename std::enable_if<!std::is_base_of<std::istream, SS>::value && std::is_base_of<std::ostream, SS>::value, typename SS::off_type>::type TellHelper() {
return stream_.tellp(); return stream_.tellp();
} }