diff --git a/sim_fio.c b/sim_fio.c index d3ed57c2..4ab86d36 100644 --- a/sim_fio.c +++ b/sim_fio.c @@ -224,13 +224,14 @@ FILE *sim_fopen (const char *file, const char *mode) #if defined (VMS) return fopen (file, mode, "ALQ=32", "DEQ=4096", "MBF=6", "MBC=127", "FOP=cbt,tef", "ROP=rah,wbh", "CTX=stm"); -#elif defined (__linux) || defined (__linux__) || defined (__hpux) +#elif (defined (__linux) || defined (__linux__) || defined (__hpux)) && !defined (DONT_DO_LARGEFILE) return fopen64 (file, mode); #else return fopen (file, mode); #endif } +#if !defined (DONT_DO_LARGEFILE) /* 64b VMS */ #if ((defined (__ALPHA) || defined (__ia64)) && defined (VMS) && (__DECC_VER >= 60590001)) || \ @@ -341,6 +342,7 @@ return (t_offset)(ftello (st)); } #endif /* end Apple OS/X */ +#endif /* !DONT_DO_LARGEFILE */ /* Default: no OS-specific routine has been defined */ diff --git a/sim_fio.h b/sim_fio.h index 8d0d988f..bacd1eb8 100644 --- a/sim_fio.h +++ b/sim_fio.h @@ -38,13 +38,17 @@ #define fxwrite(a,b,c,d) sim_fwrite (a, b, c, d) int32 sim_finit (void); -#if defined (__linux) || defined (__linux__) || defined (__hpux) || \ - (defined (VMS) && (defined (__ALPHA) || defined (__ia64)) && (__DECC_VER >= 60590001)) || \ - ((defined(__sun) || defined(__sun__)) && defined(_LARGEFILE_SOURCE)) || \ - defined (_WIN32) || defined (__APPLE__) || defined (__FreeBSD__) || defined(__NetBSD__) || defined (__OpenBSD__) +#if (defined (__linux) || defined (__linux__) || defined (__hpux) || \ + (defined (VMS) && (defined (__ALPHA) || defined (__ia64)) && (__DECC_VER >= 60590001)) || \ + ((defined(__sun) || defined(__sun__)) && defined(_LARGEFILE_SOURCE)) || \ + defined (_WIN32) || defined (__APPLE__) || \ + defined (__FreeBSD__) || defined(__NetBSD__) || defined (__OpenBSD__)) && !defined (DONT_DO_LARGEFILE) typedef t_int64 t_offset; #else typedef int32 t_offset; +#if !defined (DONT_DO_LARGEFILE) +#define DONT_DO_LARGEFILE 1 +#endif #endif FILE *sim_fopen (const char *file, const char *mode); int sim_fseek (FILE *st, t_addr offset, int whence);