use ssize_t/int64 and 64bit version of ftell on windows

This commit is contained in:
richinseattle
2023-07-29 22:46:38 -07:00
parent f61807d6ea
commit cddb05d5b2
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -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; }
+2
View File
@@ -5,6 +5,8 @@
#include <windows.h>
#include <time.h>
#define ssize_t __int64
#define ftell _ftelli64
// Below code is originally from mman-win32
//