diff --git a/libs/fst/00_PATCH_win_io.patch b/libs/fst/00_PATCH_win_io.patch index 5813758cd25..ac97f8f9b21 100644 --- a/libs/fst/00_PATCH_win_io.patch +++ b/libs/fst/00_PATCH_win_io.patch @@ -9,3 +9,42 @@ #include #else #include +--- fstapi.cc ++++ fstapi.cc +@@ -56,7 +56,7 @@ + #include + #endif + +-#ifdef __MINGW32__ ++#if defined __CYGWIN__ || defined __MINGW32__ || defined _MSC_VER + #define WIN32_LEAN_AND_MEAN + #include + #endif +@@ -159,7 +159,7 @@ void **JenkinsIns(void *base_i, const unsigned char *mem, uint32_t length, uint3 + /*** ***/ + /***********************/ + +-#ifdef __MINGW32__ ++#if defined(__MINGW32__) || defined(_MSC_VER) + #include + #ifndef HAVE_FSEEKO + #define ftello _ftelli64 +@@ -341,7 +341,7 @@ return(NULL); + /* + * mmap compatibility + */ +-#if defined __MINGW32__ ++#if defined __CYGWIN__ || defined __MINGW32__ || defined _MSC_VER + #include + #define fstMmap(__addr,__len,__prot,__flags,__fd,__off) fstMmap2((__len), (__fd), (__off)) + #define fstMunmap(__addr,__len) UnmapViewOfFile((LPCVOID)__addr) +@@ -993,7 +993,7 @@ if(pnt == NULL + ) + { + fprintf(stderr, "fstMmap() assigned to %s failed: errno: %d, file %s, line %d.\n", usage, errno, file, line); +-#if !defined(__MINGW32__) ++#if !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(_MSC_VER) + perror("Why"); + #else + LPSTR mbuf = NULL; + diff --git a/libs/fst/fstapi.cc b/libs/fst/fstapi.cc index 3b0b352337b..f85059e8c0d 100644 --- a/libs/fst/fstapi.cc +++ b/libs/fst/fstapi.cc @@ -56,7 +56,7 @@ #include #endif -#ifdef __MINGW32__ +#if defined __CYGWIN__ || defined __MINGW32__ || defined _MSC_VER #define WIN32_LEAN_AND_MEAN #include #endif @@ -159,7 +159,7 @@ void **JenkinsIns(void *base_i, const unsigned char *mem, uint32_t length, uint3 /*** ***/ /***********************/ -#ifdef __MINGW32__ +#if defined(__MINGW32__) || defined(_MSC_VER) #include #ifndef HAVE_FSEEKO #define ftello _ftelli64 @@ -341,7 +341,7 @@ return(NULL); /* * mmap compatibility */ -#if defined __MINGW32__ +#if defined __CYGWIN__ || defined __MINGW32__ || defined _MSC_VER #include #define fstMmap(__addr,__len,__prot,__flags,__fd,__off) fstMmap2((__len), (__fd), (__off)) #define fstMunmap(__addr,__len) UnmapViewOfFile((LPCVOID)__addr) @@ -993,7 +993,7 @@ if(pnt == NULL ) { fprintf(stderr, "fstMmap() assigned to %s failed: errno: %d, file %s, line %d.\n", usage, errno, file, line); -#if !defined(__MINGW32__) +#if !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(_MSC_VER) perror("Why"); #else LPSTR mbuf = NULL;