Internally use the _stati64 API explicitly on Windows
[platform/upstream/glib.git] / glib / gmappedfile.c
index 77865b8..59a1a3e 100644 (file)
@@ -38,9 +38,8 @@
 #include <windows.h>
 #include <io.h>
 
-#ifdef _MSC_VER
-#define fstat(a,b) _fstat(a,b)
-#endif
+#define fstat(a,b) _fstati64(a,b)
+#define stat _stati64
 
 #endif
 
@@ -148,7 +147,7 @@ g_mapped_file_new (const gchar  *filename,
   if (st.st_size == 0)
     {
       file->length = 0;
-      file->contents = "";
+      file->contents = NULL;
       close (fd);
       return file;
     }
@@ -242,7 +241,9 @@ g_mapped_file_get_length (GMappedFile *file)
  * Note that the contents may not be zero-terminated,
  * even if the #GMappedFile is backed by a text file.
  *
- * Returns: the contents of @file.
+ * If the file is empty then %NULL is returned.
+ *
+ * Returns: the contents of @file, or %NULL.
  *
  * Since: 2.8
  */