Allow llvm-hanafuda to serve as LLVM library

This commit is contained in:
Jack Andersen 2016-12-10 15:51:13 -10:00
parent 3371af733e
commit ed7161b7f8
2 changed files with 5 additions and 2 deletions

View File

@ -31,6 +31,9 @@ set(LLVM_ROOT_DIR "" CACHE PATH "Location of LLVM development root")
set(LLVM_FIND_COMPONENTS "")
if(WIN32)
get_filename_component(LLVM_ROOT_DIR [HKEY_LOCAL_MACHINE\\Software\\LLVM\\LLVM] ABSOLUTE)
if(NOT LLVM_ROOT_DIR OR ${LLVM_ROOT_DIR} STREQUAL "/registry")
get_filename_component(LLVM_ROOT_DIR [HKEY_LOCAL_MACHINE\\Software\\AxioDL\\llvm-hanafuda] ABSOLUTE)
endif()
endif()
set(llvm_config_names llvm-config-3.9 llvm-config39

View File

@ -174,9 +174,9 @@ atUint64 FileReader::readUBytesToBuf(void* buf, atUint64 len)
{
LARGE_INTEGER fs;
GetFileSizeEx(m_fileHandle, &fs);
if (m_offset >= fs.QuadPart)
if (m_offset >= atUint64(fs.QuadPart))
return 0;
if (m_offset + len >= fs.QuadPart)
if (m_offset + len >= atUint64(fs.QuadPart))
len = fs.QuadPart - m_offset;
size_t block = m_offset / m_blockSize;