Two small patches for utf8 I/O.
authorErik de Castro Lopo <erikd@mega-nerd.com>
Mon, 1 Apr 2013 19:27:07 +0000 (06:27 +1100)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Mon, 1 Apr 2013 19:27:12 +0000 (06:27 +1100)
Thanks to LRN <lrn1986@gmail.com>.

configure.ac
include/share/compat.h
include/share/win_utf8_io.h
src/share/win_utf8_io/win_utf8_io.c

index c8c4714..b35e44d 100644 (file)
@@ -129,6 +129,7 @@ case "$host" in
        *-*-cygwin|*mingw*|*emx*)
                # define this variable for enabling strict exports with libtool; for now, it's supported by Win32 and OS/2
                LT_NO_UNDEFINED="-no-undefined"
+               CPPFLAGS="-D__MSVCRT_VERSION__=0x0601 $CPPFLAGS"
                os_is_windows=yes
                ;;
        *)
index 98eec55..88caf1e 100644 (file)
 #endif
 
 #ifdef _WIN32
-#define flac_stat_s _stat64 /* stat struct */
+#define flac_stat_s __stat64 /* stat struct */
 #define flac_fstat _fstat64
 #else
 #define flac_stat_s stat /* stat struct */
index 598f187..b48e85e 100644 (file)
@@ -20,7 +20,7 @@ int vfprintf_utf8(FILE *stream, const char *format, va_list argptr);
 
 FILE *fopen_utf8(const char *filename, const char *mode);
 int stat_utf8(const char *path, struct stat *buffer);
-int _stat64_utf8(const char *path, struct _stat64 *buffer);
+int _stat64_utf8(const char *path, struct __stat64 *buffer);
 int chmod_utf8(const char *filename, int pmode);
 int utime_utf8(const char *filename, struct utimbuf *times);
 int unlink_utf8(const char *filename);
index 12cfd97..4b78790 100644 (file)
@@ -182,7 +182,7 @@ FILE *fopen_utf8(const char *filename, const char *mode)
        return f;
 }
 
-int _stat64_utf8(const char *path, struct _stat64 *buffer)
+int _stat64_utf8(const char *path, struct __stat64 *buffer)
 {
        wchar_t *wpath;
        int ret;