diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2015-06-19 20:12:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-07-06 15:11:01 (GMT) |
commit | 8ea69dfef1e81a9811fe8a3d7198580dd21cb48f (patch) | |
tree | a95ecffd5be71b03d50c84dc175700efdabd07d2 /Source/bindexplib.cxx | |
parent | 2963cb2a559fd27edd53b7fb7036cba0adc8b9ca (diff) | |
download | CMake-8ea69dfef1e81a9811fe8a3d7198580dd21cb48f.zip CMake-8ea69dfef1e81a9811fe8a3d7198580dd21cb48f.tar.gz CMake-8ea69dfef1e81a9811fe8a3d7198580dd21cb48f.tar.bz2 |
bindexplib: Build source as part of CMakeLib
Diffstat (limited to 'Source/bindexplib.cxx')
-rw-r--r-- | Source/bindexplib.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx index 8328213..f14d301 100644 --- a/Source/bindexplib.cxx +++ b/Source/bindexplib.cxx @@ -71,10 +71,12 @@ *---------------------------------------------------------------------- */ +#include <cmsys/Encoding.hxx> #include <windows.h> #include <stdio.h> #include <string> #include <fstream> +#include <iostream> /* + * Utility func, strstr with size @@ -89,7 +91,7 @@ const char* StrNStr(const char* start, const char* find, size_t &size) { } len = strlen(find); - while (hint = (const char*) memchr(start, find[0], size-len+1)) { + while ((hint = (const char*) memchr(start, find[0], size-len+1))) { size -= (hint - start); if (!strncmp(hint, find, len)) return hint; @@ -169,7 +171,7 @@ HaveExportedObjects(PIMAGE_FILE_HEADER pImageFileHeader, void DumpExternalsObjects(PIMAGE_SYMBOL pSymbolTable, PIMAGE_SECTION_HEADER pSectionHeaders, - FILE *fout, unsigned cSymbols) + FILE *fout, DWORD_PTR cSymbols) { unsigned i; PSTR stringTable; @@ -295,14 +297,15 @@ DumpObjFile(PIMAGE_FILE_HEADER pImageFileHeader, FILE *fout) *---------------------------------------------------------------------- */ void -DumpFile(LPSTR filename, FILE *fout) +DumpFile(const char* filename, FILE *fout) { HANDLE hFile; HANDLE hFileMapping; LPVOID lpFileBase; PIMAGE_DOS_HEADER dosHeader; - hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, + hFile = CreateFileW(cmsys::Encoding::ToWide(filename).c_str(), + GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); if (hFile == INVALID_HANDLE_VALUE) { |