Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing #24: Building issue #25

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# patterns to ignore
*.a
*.cmake
*.i
*.so
*.sw?

# paths to ignore
CMakeCache.txt
src/tests/???app
src/tests/updater_Test*
src/updater
src/zip-tool

# Auto generated files
external/minizip/Makefile
external/AnyOption/Makefile
external/tinyxml/Makefile
external/TinyThread/Makefile
src/tests/Makefile
src/Makefile
Makefile

# VS 2015 generated files
*.vcxproj*
**/*.sln
**/Debug
**/Release
Win32/

# dirs to ignore
.vs/
**/CMakeFiles/
2 changes: 1 addition & 1 deletion external/AnyOption/anyoption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ AnyOption::readFile( const char* fname )
return NULL;
}
is.seekg (0, ios::end);
length = is.tellg();
length = static_cast<int>(is.tellg());
is.seekg (0, ios::beg);
buffer = (char*) malloc(length*sizeof(char));
is.read (buffer,length);
Expand Down
6 changes: 4 additions & 2 deletions external/bzip2/bzlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1375,9 +1375,11 @@ const char * BZ_API(BZ2_bzlibVersion)(void)
#if defined(_WIN32) || defined(OS2) || defined(MSDOS)
# include <fcntl.h>
# include <io.h>
# define SET_BINARY_MODE(file) setmode(fileno(file),O_BINARY)
# define SET_BINARY_MODE(file) _setmode(_fileno(file), O_BINARY)
# define FDOPEN(file, mode) _fdopen(file, mode)
#else
# define SET_BINARY_MODE(file)
# define FDOPEN(file, mode) fdopen(file, mode)
#endif
static
BZFILE * bzopen_or_bzdopen
Expand Down Expand Up @@ -1428,7 +1430,7 @@ BZFILE * bzopen_or_bzdopen
#ifdef BZ_STRICT_ANSI
fp = NULL;
#else
fp = fdopen(fd,mode2);
fp = FDOPEN(fd,mode2);
#endif
}
if (fp == NULL) return NULL;
Expand Down
25 changes: 0 additions & 25 deletions external/minizip/Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion external/minizip/ioapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

*/

#if (defined(_WIN32))
#if defined(_WIN32) && !defined(_CRT_SECURE_NO_WARNINGS)
#define _CRT_SECURE_NO_WARNINGS
#endif

Expand Down
2 changes: 1 addition & 1 deletion external/minizip/zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ extern int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename,
unsigned char bufHead[RAND_HEAD_LEN];
unsigned int sizeHead;
zi->ci.encrypt = 1;
zi->ci.pcrc_32_tab = get_crc_table();
zi->ci.pcrc_32_tab = (const unsigned long*)(get_crc_table());
/*init_keys(password,zi->ci.keys,zi->ci.pcrc_32_tab);*/

sizeHead=crypthead(password,bufHead,RAND_HEAD_LEN,zi->ci.keys,zi->ci.pcrc_32_tab,crcForCrypting);
Expand Down
130 changes: 0 additions & 130 deletions external/tinyxml/Makefile

This file was deleted.

73 changes: 48 additions & 25 deletions external/tinyxml/tinyxml.sln
Original file line number Diff line number Diff line change
@@ -1,38 +1,61 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C++ Express 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyXmlTest", "tinyXmlTest.vcxproj", "{34719950-09E8-457E-BE23-8F1CE3A1F1F6}"
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ALL_BUILD", "ALL_BUILD.vcxproj", "{D58BEE6F-8AEC-3E00-BBF0-36B4100ECEBE}"
ProjectSection(ProjectDependencies) = postProject
{938D596F-0612-3090-BDD2-49E7938BF7B4} = {938D596F-0612-3090-BDD2-49E7938BF7B4}
{918FC0B1-7495-3F46-A443-3EEF0C232FB2} = {918FC0B1-7495-3F46-A443-3EEF0C232FB2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyXmlTestSTL", "tinyXmlTestSTL.vcxproj", "{53ED5965-5BCA-47B5-9EB0-EDD20882F22F}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RUN_TESTS", "RUN_TESTS.vcxproj", "{ED09D2A4-0002-32F8-A3C0-ADCF989FD249}"
ProjectSection(ProjectDependencies) = postProject
{938D596F-0612-3090-BDD2-49E7938BF7B4} = {938D596F-0612-3090-BDD2-49E7938BF7B4}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyxml", "tinyxml_lib.vcxproj", "{C406DAEC-0886-4771-8DEA-9D7329B46CC1}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZERO_CHECK", "..\..\\ZERO_CHECK.vcxproj", "{938D596F-0612-3090-BDD2-49E7938BF7B4}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyxmlSTL", "tinyxmlSTL.vcxproj", "{A3A84737-5017-4577-B8A2-79429A25B8B6}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyxml", "tinyxml.vcxproj", "{918FC0B1-7495-3F46-A443-3EEF0C232FB2}"
ProjectSection(ProjectDependencies) = postProject
{938D596F-0612-3090-BDD2-49E7938BF7B4} = {938D596F-0612-3090-BDD2-49E7938BF7B4}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
MinSizeRel|Win32 = MinSizeRel|Win32
RelWithDebInfo|Win32 = RelWithDebInfo|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{34719950-09E8-457E-BE23-8F1CE3A1F1F6}.Debug|Win32.ActiveCfg = Debug|Win32
{34719950-09E8-457E-BE23-8F1CE3A1F1F6}.Debug|Win32.Build.0 = Debug|Win32
{34719950-09E8-457E-BE23-8F1CE3A1F1F6}.Release|Win32.ActiveCfg = Release|Win32
{34719950-09E8-457E-BE23-8F1CE3A1F1F6}.Release|Win32.Build.0 = Release|Win32
{53ED5965-5BCA-47B5-9EB0-EDD20882F22F}.Debug|Win32.ActiveCfg = Debug|Win32
{53ED5965-5BCA-47B5-9EB0-EDD20882F22F}.Debug|Win32.Build.0 = Debug|Win32
{53ED5965-5BCA-47B5-9EB0-EDD20882F22F}.Release|Win32.ActiveCfg = Release|Win32
{53ED5965-5BCA-47B5-9EB0-EDD20882F22F}.Release|Win32.Build.0 = Release|Win32
{C406DAEC-0886-4771-8DEA-9D7329B46CC1}.Debug|Win32.ActiveCfg = Debug|Win32
{C406DAEC-0886-4771-8DEA-9D7329B46CC1}.Debug|Win32.Build.0 = Debug|Win32
{C406DAEC-0886-4771-8DEA-9D7329B46CC1}.Release|Win32.ActiveCfg = Release|Win32
{C406DAEC-0886-4771-8DEA-9D7329B46CC1}.Release|Win32.Build.0 = Release|Win32
{A3A84737-5017-4577-B8A2-79429A25B8B6}.Debug|Win32.ActiveCfg = Debug|Win32
{A3A84737-5017-4577-B8A2-79429A25B8B6}.Debug|Win32.Build.0 = Debug|Win32
{A3A84737-5017-4577-B8A2-79429A25B8B6}.Release|Win32.ActiveCfg = Release|Win32
{A3A84737-5017-4577-B8A2-79429A25B8B6}.Release|Win32.Build.0 = Release|Win32
{D58BEE6F-8AEC-3E00-BBF0-36B4100ECEBE}.Debug|Win32.ActiveCfg = Debug|Win32
{D58BEE6F-8AEC-3E00-BBF0-36B4100ECEBE}.Release|Win32.ActiveCfg = Release|Win32
{D58BEE6F-8AEC-3E00-BBF0-36B4100ECEBE}.MinSizeRel|Win32.ActiveCfg = MinSizeRel|Win32
{D58BEE6F-8AEC-3E00-BBF0-36B4100ECEBE}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32
{ED09D2A4-0002-32F8-A3C0-ADCF989FD249}.Debug|Win32.ActiveCfg = Debug|Win32
{ED09D2A4-0002-32F8-A3C0-ADCF989FD249}.Release|Win32.ActiveCfg = Release|Win32
{ED09D2A4-0002-32F8-A3C0-ADCF989FD249}.MinSizeRel|Win32.ActiveCfg = MinSizeRel|Win32
{ED09D2A4-0002-32F8-A3C0-ADCF989FD249}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32
{938D596F-0612-3090-BDD2-49E7938BF7B4}.Debug|Win32.ActiveCfg = Debug|Win32
{938D596F-0612-3090-BDD2-49E7938BF7B4}.Debug|Win32.Build.0 = Debug|Win32
{938D596F-0612-3090-BDD2-49E7938BF7B4}.Release|Win32.ActiveCfg = Release|Win32
{938D596F-0612-3090-BDD2-49E7938BF7B4}.Release|Win32.Build.0 = Release|Win32
{938D596F-0612-3090-BDD2-49E7938BF7B4}.MinSizeRel|Win32.ActiveCfg = MinSizeRel|Win32
{938D596F-0612-3090-BDD2-49E7938BF7B4}.MinSizeRel|Win32.Build.0 = MinSizeRel|Win32
{938D596F-0612-3090-BDD2-49E7938BF7B4}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32
{938D596F-0612-3090-BDD2-49E7938BF7B4}.RelWithDebInfo|Win32.Build.0 = RelWithDebInfo|Win32
{918FC0B1-7495-3F46-A443-3EEF0C232FB2}.Debug|Win32.ActiveCfg = Debug|Win32
{918FC0B1-7495-3F46-A443-3EEF0C232FB2}.Debug|Win32.Build.0 = Debug|Win32
{918FC0B1-7495-3F46-A443-3EEF0C232FB2}.Release|Win32.ActiveCfg = Release|Win32
{918FC0B1-7495-3F46-A443-3EEF0C232FB2}.Release|Win32.Build.0 = Release|Win32
{918FC0B1-7495-3F46-A443-3EEF0C232FB2}.MinSizeRel|Win32.ActiveCfg = MinSizeRel|Win32
{918FC0B1-7495-3F46-A443-3EEF0C232FB2}.MinSizeRel|Win32.Build.0 = MinSizeRel|Win32
{918FC0B1-7495-3F46-A443-3EEF0C232FB2}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32
{918FC0B1-7495-3F46-A443-3EEF0C232FB2}.RelWithDebInfo|Win32.Build.0 = RelWithDebInfo|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CF27880A-8B79-34D7-AE14-83260953B588}
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package(Threads REQUIRED)
include(GenerateCppResourceFile)

if (UNIX)
add_definitions(-Wall -Werror -Wconversion)
add_definitions(-Wall -Werror -Wconversion -std=c++11)
endif()

if (UNIX AND NOT APPLE)
Expand Down
9 changes: 3 additions & 6 deletions src/DirIterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,15 @@ bool DirIterator::next()
m_entry = readdir(m_dir);
return m_entry != 0;
#else
bool result;
if (m_firstEntry)
{
m_firstEntry = false;
return m_findHandle != INVALID_HANDLE_VALUE;
}
else
{
result = FindNextFile(m_findHandle,&m_findData);
}
return result;

return FindNextFile(m_findHandle, &m_findData) != FALSE; // to prevent warning C4800: 'BOOL': forcing value to bool*
#endif
// (*) Casting the expression to type bool will not disable the warning: https://msdn.microsoft.com/en-us/library/b6801kcy.aspx
}

std::string DirIterator::fileName() const
Expand Down
5 changes: 3 additions & 2 deletions src/ProcessUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#ifdef PLATFORM_WINDOWS
#include <windows.h>
#include <string>
#else
#include <stdlib.h>
#include <sys/wait.h>
Expand Down Expand Up @@ -438,8 +439,8 @@ int ProcessUtils::runWindows(const std::string& _executable,
PROCESS_INFORMATION processInfo;
ZeroMemory(&processInfo,sizeof(processInfo));

char* commandLineStr = strdup(commandLine.c_str());
bool result = CreateProcess(
LPSTR commandLineStr = const_cast<LPSTR>(std::string(commandLine).c_str());
BOOL result = CreateProcess(
executable.c_str(),
commandLineStr,
0 /* process attributes */,
Expand Down