File: 00_PATCH_win_io.patch

package info (click to toggle)
yosys 0.52-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 69,796 kB
  • sloc: ansic: 696,955; cpp: 239,736; python: 14,617; yacc: 3,529; sh: 2,175; makefile: 1,945; lex: 697; perl: 445; javascript: 323; tcl: 162; vhdl: 115
file content (58 lines) | stat: -rw-r--r-- 1,774 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
--- fst_win_unistd.h
+++ fst_win_unistd.h
@@ -26,7 +26,7 @@
 #define WIN_UNISTD_H
 
 #include <stdlib.h>
-#ifdef _WIN64
+#if defined(_MSC_VER)
 #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
@@ -137,7 +137,7 @@ void **JenkinsIns(void *base_i, const unsigned char *mem, uint32_t length, uint3
 #include <sys/sysctl.h>
 #endif
 
-#if defined(FST_MACOSX) || defined(__MINGW32__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
+#if defined(FST_MACOSX) || defined(__MINGW32__) || defined(_MSC_VER) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
 #define FST_UNBUFFERED_IO
 #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 __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)
@@ -4638,7 +4638,7 @@ if(sectype == FST_BL_ZWRAPPER)
 #endif
 
         fstReaderFseeko(xc, xc->f, FST_ZWRAPPER_HDR_SIZE, SEEK_SET);
-#ifndef __MINGW32__
+#if !defined(__MINGW32__) && !defined(_MSC_VER)
         fflush(xc->f);
 #else
 	/* Windows UCRT runtime library reads one byte ahead in the file