From cddb05d5b28345f0d7334b2b8a835e8d03135868 Mon Sep 17 00:00:00 2001 From: richinseattle Date: Sat, 29 Jul 2023 22:46:38 -0700 Subject: [PATCH] use ssize_t/int64 and 64bit version of ftell on windows --- run.c | 2 +- win.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/run.c b/run.c index d8f153e..5d2c487 100644 --- a/run.c +++ b/run.c @@ -483,7 +483,7 @@ int main(int argc, char *argv[]) { TransformerWeights weights; int fd = 0; // file descriptor for memory mapping float* data = NULL; // memory mapped data pointer - long file_size; // size of the checkpoint file in bytes + ssize_t file_size; // size of the checkpoint file in bytes { FILE *file = fopen(checkpoint, "rb"); if (!file) { printf("Couldn't open file %s\n", checkpoint); return 1; } diff --git a/win.h b/win.h index 12c7f39..c15ee06 100644 --- a/win.h +++ b/win.h @@ -5,6 +5,8 @@ #include #include +#define ssize_t __int64 +#define ftell _ftelli64 // Below code is originally from mman-win32 //