[libcxx] r227806 - Revert r227804: Use fseek/ftell instead of fseeko/ftello when Newlib is the libc

Jonathan Roelofs jonathan at codesourcery.com
Mon Feb 2 07:56:44 PST 2015


Author: jroelofs
Date: Mon Feb  2 09:56:43 2015
New Revision: 227806

URL: http://llvm.org/viewvc/llvm-project?rev=227806&view=rev
Log:
Revert r227804: Use fseek/ftell instead of fseeko/ftello when Newlib is the libc

This change is causing a driver crash on libcxx-libcxxabi-x86_64-linux-ubuntu-msan

Modified:
    libcxx/trunk/include/fstream
    libcxx/trunk/include/iosfwd

Modified: libcxx/trunk/include/fstream
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/fstream?rev=227806&r1=227805&r2=227806&view=diff
==============================================================================
--- libcxx/trunk/include/fstream (original)
+++ libcxx/trunk/include/fstream Mon Feb  2 09:56:43 2015
@@ -807,7 +807,7 @@ basic_filebuf<_CharT, _Traits>::seekoff(
     default:
         return pos_type(off_type(-1));
     }
-#if defined(_WIN32) || defined(_NEWLIB_VERSION)
+#if _WIN32
     if (fseek(__file_, __width > 0 ? __width * __off : 0, __whence))
         return pos_type(off_type(-1));
     pos_type __r = ftell(__file_);
@@ -826,7 +826,7 @@ basic_filebuf<_CharT, _Traits>::seekpos(
 {
     if (__file_ == 0 || sync())
         return pos_type(off_type(-1));
-#if defined(_WIN32) || defined(_NEWLIB_VERSION)
+#if _WIN32
     if (fseek(__file_, __sp, SEEK_SET))
         return pos_type(off_type(-1));
 #else
@@ -891,7 +891,7 @@ basic_filebuf<_CharT, _Traits>::sync()
                 }
             }
         }
-#if defined(_WIN32) || defined(_NEWLIB_VERSION)
+#if _WIN32
         if (fseek(__file_, -__c, SEEK_CUR))
             return -1;
 #else

Modified: libcxx/trunk/include/iosfwd
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/iosfwd?rev=227806&r1=227805&r2=227806&view=diff
==============================================================================
--- libcxx/trunk/include/iosfwd (original)
+++ libcxx/trunk/include/iosfwd Mon Feb  2 09:56:43 2015
@@ -180,12 +180,7 @@ typedef fpos<mbstate_t>    u16streampos;
 typedef fpos<mbstate_t>    u32streampos;
 #endif  // _LIBCPP_HAS_NO_UNICODE_CHARS
 
-#if defined(_NEWLIB_VERSION)
-// On newlib, off_t is 'long int'
-typedef long int streamoff;         // for char_traits in <string>
-#else
 typedef long long streamoff;        // for char_traits in <string>
-#endif
 
 template <class _CharT,             // for <stdexcept>
           class _Traits = char_traits<_CharT>,





More information about the cfe-commits mailing list