From 29e1fe136a6e48122362d35c4df15ad3fa0a06c0 Mon Sep 17 00:00:00 2001 From: PKEuS Date: Sun, 2 Oct 2016 15:48:03 +0200 Subject: [PATCH] Fixed Visual Studio build after pathmatch.h/cpp was moved to lib, fixed compiler errors about getcwd --- cli/cli.vcxproj | 2 -- cli/cli.vcxproj.filters | 6 ------ lib/cppcheck.vcxproj | 2 ++ lib/cppcheck.vcxproj.filters | 6 ++++++ lib/path.cpp | 6 ++++++ lib/pathmatch.h | 2 +- test/testrunner.vcxproj | 2 -- test/testrunner.vcxproj.filters | 6 ------ 8 files changed, 15 insertions(+), 17 deletions(-) diff --git a/cli/cli.vcxproj b/cli/cli.vcxproj index 6530566dc..241397489 100644 --- a/cli/cli.vcxproj +++ b/cli/cli.vcxproj @@ -385,7 +385,6 @@ - @@ -398,7 +397,6 @@ - diff --git a/cli/cli.vcxproj.filters b/cli/cli.vcxproj.filters index 665cea925..f95e472bb 100644 --- a/cli/cli.vcxproj.filters +++ b/cli/cli.vcxproj.filters @@ -29,17 +29,11 @@ Header Files - - Header Files - Source Files - - Source Files - Source Files diff --git a/lib/cppcheck.vcxproj b/lib/cppcheck.vcxproj index 87def3131..27b402da1 100644 --- a/lib/cppcheck.vcxproj +++ b/lib/cppcheck.vcxproj @@ -78,6 +78,7 @@ + @@ -127,6 +128,7 @@ + diff --git a/lib/cppcheck.vcxproj.filters b/lib/cppcheck.vcxproj.filters index b4b11152c..fbeb2f233 100644 --- a/lib/cppcheck.vcxproj.filters +++ b/lib/cppcheck.vcxproj.filters @@ -149,6 +149,9 @@ Source Files + + Source Files + @@ -298,6 +301,9 @@ Header Files + + Header Files + diff --git a/lib/path.cpp b/lib/path.cpp index 97d05d4d3..ebec372c8 100644 --- a/lib/path.cpp +++ b/lib/path.cpp @@ -27,6 +27,8 @@ #include #ifndef _WIN32 #include +#else +#include #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; diff --git a/lib/pathmatch.h b/lib/pathmatch.h index 0e9201a38..b3db17fe9 100644 --- a/lib/pathmatch.h +++ b/lib/pathmatch.h @@ -28,7 +28,7 @@ /** * @brief Simple path matching for ignoring paths in CLI. */ -class PathMatch { +class CPPCHECKLIB PathMatch { public: /** diff --git a/test/testrunner.vcxproj b/test/testrunner.vcxproj index 8c63a58c8..11f7ba8cc 100644 --- a/test/testrunner.vcxproj +++ b/test/testrunner.vcxproj @@ -27,7 +27,6 @@ - @@ -94,7 +93,6 @@ - diff --git a/test/testrunner.vcxproj.filters b/test/testrunner.vcxproj.filters index e00e47f20..1133e9811 100644 --- a/test/testrunner.vcxproj.filters +++ b/test/testrunner.vcxproj.filters @@ -124,9 +124,6 @@ Source Files - - Source Files - Source Files @@ -216,9 +213,6 @@ Header Files - - Header Files - Header Files