Fix a couple of Windows 2Gig file size issues.
[platform/upstream/flac.git] / src / share / grabbag / file.c
index a95cd3f..04e3aad 100644 (file)
@@ -61,11 +61,17 @@ void grabbag__file_copy_metadata(const char *srcpath, const char *destpath)
        }
 }
 
-off_t grabbag__file_get_filesize(const char *srcpath)
+FLAC__off_t grabbag__file_get_filesize(const char *srcpath)
 {
+#if defined _MSC_VER || defined __MINGW32__
+       struct _stat64 srcstat;
+
+       if(0 == _stat64(srcpath, &srcstat))
+#else
        struct stat srcstat;
 
        if(0 == stat(srcpath, &srcstat))
+#endif
                return srcstat.st_size;
        else
                return -1;