aboutsummaryrefslogtreecommitdiffstats
path: root/libs/fst/fstapi.h
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2022-02-02 11:46:06 +0100
committerMiodrag Milanovic <mmicko@gmail.com>2022-02-02 11:46:06 +0100
commit4a30c9cb9418869b34da3f304c7e3cc72a0ffe62 (patch)
tree1256c1664d379ba8045eb297553089dd81e2cc62 /libs/fst/fstapi.h
parent990aee5531f41fdf01887870047eb924f12618b9 (diff)
downloadyosys-4a30c9cb9418869b34da3f304c7e3cc72a0ffe62.tar.gz
yosys-4a30c9cb9418869b34da3f304c7e3cc72a0ffe62.tar.bz2
yosys-4a30c9cb9418869b34da3f304c7e3cc72a0ffe62.zip
Fix Visual Studio build
Diffstat (limited to 'libs/fst/fstapi.h')
-rw-r--r--libs/fst/fstapi.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/libs/fst/fstapi.h b/libs/fst/fstapi.h
index ca8e3008f..a5e0971a1 100644
--- a/libs/fst/fstapi.h
+++ b/libs/fst/fstapi.h
@@ -33,11 +33,29 @@ extern "C" {
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
-#include <zlib.h>
#include <inttypes.h>
#if defined(_MSC_VER)
-#include "fst_win_unistd.h"
+#include "libs/zlib/zlib.h"
+#include <io.h>
+
+#include <process.h>
+
+#define ftruncate _chsize_s
+#define unlink _unlink
+#define fileno _fileno
+#define lseek _lseeki64
+
+#ifdef _WIN64
+#define ssize_t __int64
+#define SSIZE_MAX 9223372036854775807i64
#else
+#define ssize_t long
+#define SSIZE_MAX 2147483647L
+#endif
+
+#include "stdint.h"
+#else
+#include <zlib.h>
#include <unistd.h>
#endif
#include <time.h>