diff --git a/src/io.c b/src/io.c index 36c29769..49bcfdf6 100644 --- a/src/io.c +++ b/src/io.c @@ -29,7 +29,7 @@ */ #include "matio_private.h" -#if defined(_WIN32) && defined(_MSC_VER) +#if defined(_WIN32) #define WIN32_LEAN_AND_MEAN #define NOGDI #include @@ -75,7 +75,7 @@ strdup_vprintf(const char *format, va_list ap) return buffer; } -#if defined(_WIN32) && defined(_MSC_VER) +#if defined(_WIN32) /** @brief Convert from narrow UTF-8 string to wide string * * @ingroup mat_util diff --git a/src/mat.c b/src/mat.c index b3845618..15bec89c 100644 --- a/src/mat.c +++ b/src/mat.c @@ -483,7 +483,7 @@ Mat_Open(const char *matname, int mode) size_t bytesread = 0; if ( (mode & 0x01) == MAT_ACC_RDONLY ) { -#if defined(_WIN32) && defined(_MSC_VER) +#if defined(_WIN32) wchar_t *wname = utf82u(matname); if ( NULL != wname ) { fp = _wfopen(wname, L"rb"); @@ -497,7 +497,7 @@ Mat_Open(const char *matname, int mode) return NULL; } } else if ( (mode & 0x01) == MAT_ACC_RDWR ) { -#if defined(_WIN32) && defined(_MSC_VER) +#if defined(_WIN32) wchar_t *wname = utf82u(matname); if ( NULL != wname ) { fp = _wfopen(wname, L"r+b"); @@ -1262,7 +1262,7 @@ Mat_CopyFile(const char *src, const char *dst) FILE *in = NULL; FILE *out = NULL; -#if defined(_WIN32) && defined(_MSC_VER) +#if defined(_WIN32) { wchar_t *wname = utf82u(src); if ( NULL != wname ) { @@ -1278,7 +1278,7 @@ Mat_CopyFile(const char *src, const char *dst) return MATIO_E_FILESYSTEM_COULD_NOT_OPEN; } -#if defined(_WIN32) && defined(_MSC_VER) +#if defined(_WIN32) { wchar_t *wname = utf82u(dst); if ( NULL != wname ) { diff --git a/src/mat4.c b/src/mat4.c index 7fa5519d..433c2213 100644 --- a/src/mat4.c +++ b/src/mat4.c @@ -59,7 +59,7 @@ Mat_Create4(const char *matname) FILE *fp = NULL; mat_t *mat = NULL; -#if defined(_WIN32) && defined(_MSC_VER) +#if defined(_WIN32) wchar_t *wname = utf82u(matname); if ( NULL != wname ) { fp = _wfopen(wname, L"w+b"); diff --git a/src/mat5.c b/src/mat5.c index 20795897..db19fbb7 100644 --- a/src/mat5.c +++ b/src/mat5.c @@ -635,7 +635,7 @@ Mat_Create5(const char *matname, const char *hdr_str) size_t err; time_t t; -#if defined(_WIN32) && defined(_MSC_VER) +#if defined(_WIN32) wchar_t *wname = utf82u(matname); if ( NULL != wname ) { fp = _wfopen(wname, L"w+b"); diff --git a/src/mat73.c b/src/mat73.c index ac76be17..bf43551f 100644 --- a/src/mat73.c +++ b/src/mat73.c @@ -2548,7 +2548,7 @@ Mat_Create73(const char *matname, const char *hdr_str) H5Fclose(fid); H5Pclose(plist_id); -#if defined(_WIN32) && defined(_MSC_VER) && H5_VERSION_GE(1, 11, 6) +#if defined(_WIN32) && H5_VERSION_GE(1, 11, 6) { wchar_t *wname = utf82u(matname); if ( NULL != wname ) { diff --git a/src/matio_private.h b/src/matio_private.h index afbf71f0..395e1659 100644 --- a/src/matio_private.h +++ b/src/matio_private.h @@ -41,18 +41,19 @@ #endif #if defined(__BORLANDC__) || defined(__MINGW32__) || defined(_MSC_VER) -#define mat_off_t __int64 #if defined(_MSC_VER) && defined(HAVE__FSEEKI64) && defined(HAVE__FTELLI64) #define MATIO_LFS +#define mat_off_t __int64 #define fseeko _fseeki64 #define ftello _ftelli64 #elif defined(__BORLANDC__) && defined(HAVE__FSEEKI64) && defined(HAVE__FTELLI64) #define MATIO_LFS +#define mat_off_t __int64 #define fseeko _fseeki64 #define ftello _ftelli64 -#elif !defined(HAVE_FSEEKO) && !defined(HAVE_FTELLO) && defined(HAVE_FSEEKO64) && \ - defined(HAVE_FTELLO64) +#elif defined(HAVE_FSEEKO64) && defined(HAVE_FTELLO64) #define MATIO_LFS +#define mat_off_t __int64 #define fseeko fseeko64 #define ftello ftello64 #endif @@ -266,7 +267,7 @@ EXTERN int IsEndOfFile(FILE *fp, mat_off_t *fpos); EXTERN int CheckSeekFile(FILE *fp, mat_off_t offset); /* io.c */ -#if defined(_WIN32) && defined(_MSC_VER) +#if defined(_WIN32) EXTERN wchar_t *utf82u(const char *src); #endif