Added a check for _filelengthi64 in configuration. When found, this will be used instead of fstat when computing file length.

This commit is contained in:
Ward Fisher 2013-11-04 12:58:33 -07:00
parent bda59030cb
commit 5566cbb772
3 changed files with 5 additions and 2 deletions

View File

@ -865,7 +865,7 @@ CHECK_FUNCTION_EXISTS(getpagesize HAVE_GETPAGESIZE)
CHECK_FUNCTION_EXISTS(sysconf HAVE_SYSCONF)
CHECK_FUNCTION_EXISTS(mremap HAVE_MREMAP)
CHECK_FUNCTION_EXISTS(getrlimit HAVE_GETRLIMIT)
CHECK_FUNCTION_EXISTS(_filelengthi64 HAVE_FILE_LENGTH_I64)
#####
# End system inspection checks.

View File

@ -197,6 +197,9 @@ are set when opening a binary file on Windows. */
/* Define to 1 if you have the BaseTsd.h header file. */
#cmakedefine HAVE_BASETSD_H @HAVE_BASETSD_H@
/* Define if we have filelengthi64. */
#cmakedefine HAVE_FILE_LENGTH_I64 @HAVE_FILE_LENGTH_I64@
/* The size of `double` as computed by sizeof. */
#cmakedefine SIZEOF_DOUBLE @SIZEOF_DOUBLE@
/* The size of `float` as computed by sizeof. */

View File

@ -1732,7 +1732,7 @@ ncio_px_filesize(ncio *nciop, off_t *filesizep)
/* There is a problem with fstat on Windows based systems
which manifests (so far) when Config RELEASE is built.
Use _filelengthi64 isntead. */
#ifdef _MSC_VER
#ifdef HAVE_FILE_LENGTH_I64
__int64 file_len = 0;
if( (file_len = _filelengthi64(nciop->fd)) < 0) {