libs/fst: Patch more _MSC_VER checks

This commit is contained in:
Krystine Sherwin 2024-10-17 07:05:24 +13:00
parent 827e5baca7
commit 2157f67184
No known key found for this signature in database
2 changed files with 32 additions and 3 deletions

View File

@ -9,3 +9,32 @@
#include <io.h>
#else
#include <sys/io.h>
--- fstapi.cc
+++ fstapi.cc
@@ -56,7 +56,7 @@
#include <pthread.h>
#endif
-#ifdef __MINGW32__
+#if defined __CYGWIN__ || defined __MINGW32__ || defined _MSC_VER
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#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 <io.h>
#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 <limits.h>
#define fstMmap(__addr,__len,__prot,__flags,__fd,__off) fstMmap2((__len), (__fd), (__off))
#define fstMunmap(__addr,__len) UnmapViewOfFile((LPCVOID)__addr)

View File

@ -56,7 +56,7 @@
#include <pthread.h>
#endif
#ifdef __MINGW32__
#if defined __CYGWIN__ || defined __MINGW32__ || defined _MSC_VER
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#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 <io.h>
#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 <limits.h>
#define fstMmap(__addr,__len,__prot,__flags,__fd,__off) fstMmap2((__len), (__fd), (__off))
#define fstMunmap(__addr,__len) UnmapViewOfFile((LPCVOID)__addr)