diff options
Diffstat (limited to 'innobase/os')
-rw-r--r-- | innobase/os/os0file.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 1da66fdc512..b2881581fc7 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -669,13 +669,14 @@ os_file_get_size( return(FALSE); } -#if SIZEOF_OFF_T > 4 - *size = (ulint)(offs & 0xFFFFFFFF); - *size_high = (ulint)(offs >> 32); -#else - *size = (ulint) offs; - *size_high = 0; -#endif + if (sizeof(off_t) > 4) { + *size = (ulint)(offs & 0xFFFFFFFF); + *size_high = (ulint)(offs >> 32); + } else { + *size = (ulint) offs; + *size_high = 0; + } + return(TRUE); #endif } @@ -838,16 +839,18 @@ os_file_pread( /* If off_t is > 4 bytes in size, then we assume we can pass a 64-bit address */ -#if SIZEOF_OFF_T > 4 - offs = (off_t)offset + (((off_t)offset_high) << 32); -#else - offs = (off_t)offset; + if (sizeof(off_t) > 4) { + offs = (off_t)offset + (((off_t)offset_high) << 32); + + } else { + offs = (off_t)offset; - if (offset_high > 0) { - fprintf(stderr, - "InnoDB: Error: file read at offset > 4 GB\n"); + if (offset_high > 0) { + fprintf(stderr, + "InnoDB: Error: file read at offset > 4 GB\n"); + } } -#endif + os_n_file_reads++; #ifdef HAVE_PREAD |