From e2a6d47383d2a7577ef541374195189911e29a50 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Thu, 17 Oct 2024 05:32:12 +1300 Subject: [PATCH] libs/fst: Patch more _MSC_VER checks --- libs/fst/00_PATCH_win_io.patch | 29 +++++++++++++++++++++++++++++ libs/fst/fstapi.cc | 6 +++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/libs/fst/00_PATCH_win_io.patch b/libs/fst/00_PATCH_win_io.patch index 5813758cd25..1105538e583 100644 --- a/libs/fst/00_PATCH_win_io.patch +++ b/libs/fst/00_PATCH_win_io.patch @@ -9,3 +9,32 @@ #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) diff --git a/libs/fst/fstapi.cc b/libs/fst/fstapi.cc index 3b0b352337b..00a30490987 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)