mirror of
https://git.mirrors.martin98.com/https://github.com/google/draco
synced 2025-08-14 05:45:53 +08:00
draco: Complete the large file support fix in the stdio reader.
Builds on the Windows-only fix added in https://github.com/google/draco/pull/691
This commit is contained in:
parent
4469f97beb
commit
194b55a799
@ -63,6 +63,11 @@ macro(draco_set_build_definitions)
|
|||||||
if(BUILD_SHARED_LIBS)
|
if(BUILD_SHARED_LIBS)
|
||||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
|
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
else()
|
||||||
|
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
||||||
|
# Ensure 64-bit platforms can support large files.
|
||||||
|
list(APPEND draco_defines "_LARGEFILE_SOURCE" "_FILE_OFFSET_BITS=64")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
|
@ -87,13 +87,14 @@ size_t StdioFileReader::GetFileSize() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if _FILE_OFFSET_BITS == 64
|
||||||
|
const size_t file_size = static_cast<size_t>(ftello(file_));
|
||||||
#if defined(_WIN64)
|
#elif defined _WIN64
|
||||||
const size_t file_size = static_cast<size_t>(_ftelli64(file_));
|
const size_t file_size = static_cast<size_t>(_ftelli64(file_));
|
||||||
#else
|
#else
|
||||||
const size_t file_size = static_cast<size_t>(ftell(file_));
|
const size_t file_size = static_cast<size_t>(ftell(file_));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rewind(file_);
|
rewind(file_);
|
||||||
|
|
||||||
return file_size;
|
return file_size;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user