Make it work on win32

This commit is contained in:
2021-12-12 13:35:35 +03:00
committed by Ivan Baravy
parent 07e262d8b8
commit 334866c209
15 changed files with 575 additions and 117 deletions

View File

@@ -7,6 +7,11 @@
#include "trace.h"
#include "vdisk.h"
#ifdef _WIN32
#define fseeko _fseeki64
#define ftello _ftelli64
#endif
typedef struct {
FILE *file;
uint32_t sect_size;
@@ -16,7 +21,7 @@ typedef struct {
} vdisk_t;
void *vdisk_init(const char *fname, int adjust_cache_size, size_t cache_size) {
FILE *f = fopen(fname, "r+");
FILE *f = fopen(fname, "rb+");
if (!f) {
printf("vdisk: can't open file '%s': %s\n", fname, strerror(errno));
return NULL;