11 |
|
#include "platform.h" |
12 |
|
#include "rtio.h" |
13 |
|
#include "resolu.h" |
14 |
< |
#ifdef _WIN32 |
15 |
< |
#undef ftello |
16 |
< |
#define ftello ftell |
17 |
< |
#undef ssize_t |
18 |
< |
#define ssize_t size_t |
14 |
> |
#if defined(_WIN32) || defined(_WIN64) |
15 |
> |
#undef ftello |
16 |
> |
#define ftello ftell |
17 |
> |
#undef ssize_t |
18 |
> |
#define ssize_t size_t |
19 |
|
#else |
20 |
< |
#include <sys/mman.h> |
20 |
> |
#include <sys/mman.h> |
21 |
|
#endif |
22 |
|
|
23 |
– |
#ifdef getc_unlocked /* avoid horrendous overhead of flockfile */ |
24 |
– |
#undef getc |
25 |
– |
#undef putc |
26 |
– |
#define getc getc_unlocked |
27 |
– |
#define putc putc_unlocked |
28 |
– |
#endif |
29 |
– |
|
23 |
|
typedef struct { |
24 |
|
void *base; /* pointer to base memory */ |
25 |
|
size_t len; /* allocated memory length */ |
92 |
|
int fd; |
93 |
|
off_t skip, flen; |
94 |
|
|
95 |
< |
#ifdef _WIN32 /* too difficult to fix this */ |
95 |
> |
#if defined(_WIN32) || defined(_WIN64) |
96 |
> |
/* too difficult to fix this */ |
97 |
|
return load_stream(mp, fp); |
98 |
|
#endif |
99 |
|
if (mp == NULL) |