Fix compilation errors related to rpl_mkdir on mingw.
[gnulib.git] / lib / freadptr.c
index 33471a0..ec48323 100644 (file)
@@ -27,7 +27,7 @@ freadptr (FILE *fp, size_t *sizep)
   size_t size;
 
   /* Keep this code in sync with freadahead!  */
-#if defined _IO_ferror_unlocked     /* GNU libc, BeOS */
+#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */
   if (fp->_IO_write_ptr > fp->_IO_write_base)
     return NULL;
   size = fp->_IO_read_end - fp->_IO_read_ptr;
@@ -50,7 +50,7 @@ freadptr (FILE *fp, size_t *sizep)
            fp->_ungetc_count = 0 implies fp->_rcount >= 0.  */
   if (fp->_rcount <= 0)
     return NULL;
-  if (fp->_ungetc_count == 0)
+  if (!(fp->_ungetc_count == 0))
     abort ();
   *sizep = fp->_rcount;
   return fp->_ptr;