Skip to content

Commit 878bcd6

Browse files
libs/fst: Patch more _MSC_VER checks
1 parent 6c79d41 commit 878bcd6

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

libs/fst/00_PATCH_win_io.patch

+21
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,24 @@
99
#include <io.h>
1010
#else
1111
#include <sys/io.h>
12+
--- fstapi.cc
13+
+++ fstapi.cc
14+
@@ -341,7 +341,7 @@ return(NULL);
15+
/*
16+
* mmap compatibility
17+
*/
18+
-#if defined __MINGW32__
19+
+#if defined __CYGWIN__ || defined __MINGW32__ || defined _MSC_VER
20+
#include <limits.h>
21+
#define fstMmap(__addr,__len,__prot,__flags,__fd,__off) fstMmap2((__len), (__fd), (__off))
22+
#define fstMunmap(__addr,__len) UnmapViewOfFile((LPCVOID)__addr)
23+
@@ -993,7 +993,7 @@ if(pnt == NULL
24+
)
25+
{
26+
fprintf(stderr, "fstMmap() assigned to %s failed: errno: %d, file %s, line %d.\n", usage, errno, file, line);
27+
-#if !defined(__MINGW32__)
28+
+#if !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(_MSC_VER)
29+
perror("Why");
30+
#else
31+
LPSTR mbuf = NULL;
32+

libs/fst/fstapi.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ void **JenkinsIns(void *base_i, const unsigned char *mem, uint32_t length, uint3
159159
/*** ***/
160160
/***********************/
161161

162-
#ifdef __MINGW32__
162+
#if defined(__MINGW32__) || defined(_MSC_VER)
163163
#include <io.h>
164164
#ifndef HAVE_FSEEKO
165165
#define ftello _ftelli64
@@ -341,7 +341,7 @@ return(NULL);
341341
/*
342342
* mmap compatibility
343343
*/
344-
#if defined __MINGW32__
344+
#if defined __CYGWIN__ || defined __MINGW32__ || defined _MSC_VER
345345
#include <limits.h>
346346
#define fstMmap(__addr,__len,__prot,__flags,__fd,__off) fstMmap2((__len), (__fd), (__off))
347347
#define fstMunmap(__addr,__len) UnmapViewOfFile((LPCVOID)__addr)
@@ -993,7 +993,7 @@ if(pnt == NULL
993993
)
994994
{
995995
fprintf(stderr, "fstMmap() assigned to %s failed: errno: %d, file %s, line %d.\n", usage, errno, file, line);
996-
#if !defined(__MINGW32__)
996+
#if !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(_MSC_VER)
997997
perror("Why");
998998
#else
999999
LPSTR mbuf = NULL;

0 commit comments

Comments
 (0)