Fixed Visual Studio build after pathmatch.h/cpp was moved to lib, fixed compiler errors about getcwd

This commit is contained in:
PKEuS 2016-10-02 15:48:03 +02:00
parent fff8aa8590
commit 29e1fe136a
8 changed files with 15 additions and 17 deletions

View File

@ -385,7 +385,6 @@
<ClInclude Include="cmdlineparser.h" />
<ClInclude Include="cppcheckexecutor.h" />
<ClInclude Include="filelister.h" />
<ClInclude Include="pathmatch.h" />
<ClInclude Include="threadexecutor.h" />
</ItemGroup>
<ItemGroup>
@ -398,7 +397,6 @@
<ClCompile Include="cppcheckexecutor.cpp" />
<ClCompile Include="filelister.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="pathmatch.cpp" />
<ClCompile Include="threadexecutor.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View File

@ -29,17 +29,11 @@
<ClInclude Include="filelister.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="pathmatch.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pathmatch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="threadexecutor.cpp">
<Filter>Source Files</Filter>
</ClCompile>

View File

@ -78,6 +78,7 @@
<ClCompile Include="library.cpp" />
<ClCompile Include="mathlib.cpp" />
<ClCompile Include="path.cpp" />
<ClCompile Include="pathmatch.cpp" />
<ClCompile Include="platform.cpp" />
<ClCompile Include="preprocessor.cpp" />
<ClCompile Include="importproject.cpp" />
@ -127,6 +128,7 @@
<ClInclude Include="library.h" />
<ClInclude Include="mathlib.h" />
<ClInclude Include="path.h" />
<ClInclude Include="pathmatch.h" />
<ClInclude Include="platform.h" />
<ClInclude Include="preprocessor.h" />
<ClInclude Include="importproject.h" />

View File

@ -149,6 +149,9 @@
<ClCompile Include="platform.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="pathmatch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="checkbufferoverrun.h">
@ -298,6 +301,9 @@
<ClInclude Include="platform.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="pathmatch.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="version.rc" />

View File

@ -27,6 +27,8 @@
#include <cctype>
#ifndef _WIN32
#include <unistd.h>
#else
#include <direct.h>
#endif
/** Is the filesystem case insensitive? */
@ -190,7 +192,11 @@ const std::string Path::getCurrentPath()
{
char currentPath[4096];
#ifndef _WIN32
if (getcwd(currentPath, 4096) != 0)
#else
if (_getcwd(currentPath, 4096) != 0)
#endif
return std::string(currentPath);
return emptyString;

View File

@ -28,7 +28,7 @@
/**
* @brief Simple path matching for ignoring paths in CLI.
*/
class PathMatch {
class CPPCHECKLIB PathMatch {
public:
/**

View File

@ -27,7 +27,6 @@
<ClCompile Include="..\cli\cmdlineparser.cpp" />
<ClCompile Include="..\cli\cppcheckexecutor.cpp" />
<ClCompile Include="..\cli\filelister.cpp" />
<ClCompile Include="..\cli\pathmatch.cpp" />
<ClCompile Include="..\cli\threadexecutor.cpp" />
<ClCompile Include="options.cpp" />
<ClCompile Include="test64bit.cpp" />
@ -94,7 +93,6 @@
<ItemGroup>
<ClInclude Include="..\cli\cmdlineparser.h" />
<ClInclude Include="..\cli\filelister.h" />
<ClInclude Include="..\cli\pathmatch.h" />
<ClInclude Include="..\cli\threadexecutor.h" />
<ClInclude Include="..\lib\config.h" />
<ClInclude Include="options.h" />

View File

@ -124,9 +124,6 @@
<ClCompile Include="testunusedvar.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\cli\pathmatch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\cli\filelister.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@ -216,9 +213,6 @@
<ClInclude Include="testutils.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\cli\pathmatch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\cli\filelister.h">
<Filter>Header Files</Filter>
</ClInclude>