From 24878f7ac86f8c021d4e008216dabab54250a72b Mon Sep 17 00:00:00 2001 From: cngzhnp Date: Mon, 10 Aug 2020 01:35:21 +0300 Subject: [PATCH] Fix forward declarations and missing pragma once --- toolsrc/include/vcpkg/archives.h | 5 ++++- toolsrc/include/vcpkg/buildenvironment.h | 6 ++++-- toolsrc/include/vcpkg/cmakevars.h | 6 +++++- toolsrc/include/vcpkg/commands.contact.h | 1 + toolsrc/include/vcpkg/commands.create.h | 1 + toolsrc/include/vcpkg/commands.dependinfo.h | 1 + toolsrc/include/vcpkg/commands.edit.h | 1 + .../include/vcpkg/commands.format-manifest.h | 1 + toolsrc/include/vcpkg/commands.h | 11 ++++------- toolsrc/include/vcpkg/commands.info.h | 1 + toolsrc/include/vcpkg/commands.integrate.h | 1 + toolsrc/include/vcpkg/commands.interface.h | 13 +++++++++++-- toolsrc/include/vcpkg/commands.list.h | 1 + toolsrc/include/vcpkg/commands.owns.h | 1 + toolsrc/include/vcpkg/commands.search.h | 1 + toolsrc/include/vcpkg/commands.setinstalled.h | 1 + toolsrc/include/vcpkg/commands.upgrade.h | 1 + toolsrc/include/vcpkg/commands.xvsinstances.h | 1 + toolsrc/include/vcpkg/dependencies.h | 19 +++++++++++++++---- toolsrc/include/vcpkg/export.ifw.h | 6 +++++- toolsrc/include/vcpkg/help.h | 1 + toolsrc/src/vcpkg/archives.cpp | 1 + toolsrc/src/vcpkg/buildenvironment.cpp | 1 + toolsrc/src/vcpkg/commands.ciclean.cpp | 1 + toolsrc/src/vcpkg/commands.contact.cpp | 1 + toolsrc/src/vcpkg/commands.create.cpp | 2 ++ toolsrc/src/vcpkg/commands.fetch.cpp | 2 ++ toolsrc/src/vcpkg/commands.hash.cpp | 3 +++ toolsrc/src/vcpkg/commands.integrate.cpp | 1 + toolsrc/src/vcpkg/commands.porthistory.cpp | 1 + toolsrc/src/vcpkg/commands.version.cpp | 1 + toolsrc/src/vcpkg/commands.xvsinstances.cpp | 2 +- 32 files changed, 77 insertions(+), 19 deletions(-) diff --git a/toolsrc/include/vcpkg/archives.h b/toolsrc/include/vcpkg/archives.h index 073217064b1fb1..b24e9234b57744 100644 --- a/toolsrc/include/vcpkg/archives.h +++ b/toolsrc/include/vcpkg/archives.h @@ -2,7 +2,10 @@ #include -#include +namespace vcpkg +{ + struct VcpkgPaths; +} namespace vcpkg::Archives { diff --git a/toolsrc/include/vcpkg/buildenvironment.h b/toolsrc/include/vcpkg/buildenvironment.h index 1216caa2a018d0..a1684fa7ba41bb 100644 --- a/toolsrc/include/vcpkg/buildenvironment.h +++ b/toolsrc/include/vcpkg/buildenvironment.h @@ -1,12 +1,14 @@ -#include +#pragma once -#include +#include #include #include namespace vcpkg { + struct VcpkgPaths; + std::string make_cmake_cmd(const VcpkgPaths& paths, const fs::path& cmake_script, std::vector&& pass_variables); diff --git a/toolsrc/include/vcpkg/cmakevars.h b/toolsrc/include/vcpkg/cmakevars.h index 1c02376b9ff2ed..4b2ab4edb77c7f 100644 --- a/toolsrc/include/vcpkg/cmakevars.h +++ b/toolsrc/include/vcpkg/cmakevars.h @@ -3,13 +3,17 @@ #include #include -#include namespace vcpkg::Dependencies { struct ActionPlan; } +namespace vcpkg +{ + struct VcpkgPaths; +} + namespace vcpkg::CMakeVars { struct CMakeVarProvider diff --git a/toolsrc/include/vcpkg/commands.contact.h b/toolsrc/include/vcpkg/commands.contact.h index f0af41c14aef4e..b218eb57aa6d0a 100644 --- a/toolsrc/include/vcpkg/commands.contact.h +++ b/toolsrc/include/vcpkg/commands.contact.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace vcpkg::Commands::Contact { diff --git a/toolsrc/include/vcpkg/commands.create.h b/toolsrc/include/vcpkg/commands.create.h index a8eb99b273d0dd..138632dbbc0f92 100644 --- a/toolsrc/include/vcpkg/commands.create.h +++ b/toolsrc/include/vcpkg/commands.create.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace vcpkg::Commands::Create { diff --git a/toolsrc/include/vcpkg/commands.dependinfo.h b/toolsrc/include/vcpkg/commands.dependinfo.h index 81301b6d9c6c9c..8e88adfb9091fa 100644 --- a/toolsrc/include/vcpkg/commands.dependinfo.h +++ b/toolsrc/include/vcpkg/commands.dependinfo.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace vcpkg::Commands::DependInfo { diff --git a/toolsrc/include/vcpkg/commands.edit.h b/toolsrc/include/vcpkg/commands.edit.h index 9a37d2ee3d2cfe..44c26a56dc62df 100644 --- a/toolsrc/include/vcpkg/commands.edit.h +++ b/toolsrc/include/vcpkg/commands.edit.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace vcpkg::Commands::Edit { diff --git a/toolsrc/include/vcpkg/commands.format-manifest.h b/toolsrc/include/vcpkg/commands.format-manifest.h index 1317bbc705febc..dfa2a5b4a6bd50 100644 --- a/toolsrc/include/vcpkg/commands.format-manifest.h +++ b/toolsrc/include/vcpkg/commands.format-manifest.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace vcpkg::Commands::FormatManifest { diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index 948d4b5e84f78b..38afdfa89c1b0f 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -1,16 +1,13 @@ #pragma once #include -#include -#include -#include - -#include -#include -#include namespace vcpkg::Commands { + struct BasicCommand; + struct PathsCommand; + struct TripletCommand; + template struct PackageNameAndFunction { diff --git a/toolsrc/include/vcpkg/commands.info.h b/toolsrc/include/vcpkg/commands.info.h index 556d1eb012da82..221248e590ad53 100644 --- a/toolsrc/include/vcpkg/commands.info.h +++ b/toolsrc/include/vcpkg/commands.info.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace vcpkg::Commands::Info { diff --git a/toolsrc/include/vcpkg/commands.integrate.h b/toolsrc/include/vcpkg/commands.integrate.h index 162f49a3c34baf..e009b9e5a045e2 100644 --- a/toolsrc/include/vcpkg/commands.integrate.h +++ b/toolsrc/include/vcpkg/commands.integrate.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace vcpkg::Commands::Integrate { diff --git a/toolsrc/include/vcpkg/commands.interface.h b/toolsrc/include/vcpkg/commands.interface.h index 10d213522007bc..e6ac3b326bc52f 100644 --- a/toolsrc/include/vcpkg/commands.interface.h +++ b/toolsrc/include/vcpkg/commands.interface.h @@ -1,7 +1,16 @@ #pragma once -#include -#include +#include + +namespace vcpkg +{ + struct VcpkgCmdArguments; + struct VcpkgPaths; + namespace Files + { + struct Filesystem; + } +} namespace vcpkg::Commands { diff --git a/toolsrc/include/vcpkg/commands.list.h b/toolsrc/include/vcpkg/commands.list.h index 77a5f41bdb3217..41e1a6e65cab1e 100644 --- a/toolsrc/include/vcpkg/commands.list.h +++ b/toolsrc/include/vcpkg/commands.list.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace vcpkg::Commands::List { diff --git a/toolsrc/include/vcpkg/commands.owns.h b/toolsrc/include/vcpkg/commands.owns.h index 13676b2bd96a36..39037649da3b0e 100644 --- a/toolsrc/include/vcpkg/commands.owns.h +++ b/toolsrc/include/vcpkg/commands.owns.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace vcpkg::Commands::Owns { diff --git a/toolsrc/include/vcpkg/commands.search.h b/toolsrc/include/vcpkg/commands.search.h index 6220a886630e5c..530a3ac2816e0c 100644 --- a/toolsrc/include/vcpkg/commands.search.h +++ b/toolsrc/include/vcpkg/commands.search.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace vcpkg::Commands::Search { diff --git a/toolsrc/include/vcpkg/commands.setinstalled.h b/toolsrc/include/vcpkg/commands.setinstalled.h index c5723669bd7307..0dab45f085a7d3 100644 --- a/toolsrc/include/vcpkg/commands.setinstalled.h +++ b/toolsrc/include/vcpkg/commands.setinstalled.h @@ -3,6 +3,7 @@ #include #include #include +#include namespace vcpkg::Commands::SetInstalled { diff --git a/toolsrc/include/vcpkg/commands.upgrade.h b/toolsrc/include/vcpkg/commands.upgrade.h index 340a70c97cd42b..ef8c546f2cfe1a 100644 --- a/toolsrc/include/vcpkg/commands.upgrade.h +++ b/toolsrc/include/vcpkg/commands.upgrade.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace vcpkg::Commands::Upgrade { diff --git a/toolsrc/include/vcpkg/commands.xvsinstances.h b/toolsrc/include/vcpkg/commands.xvsinstances.h index fc7a39b98bc5ba..5bfb805ea9063b 100644 --- a/toolsrc/include/vcpkg/commands.xvsinstances.h +++ b/toolsrc/include/vcpkg/commands.xvsinstances.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace vcpkg::Commands::X_VSInstances { diff --git a/toolsrc/include/vcpkg/dependencies.h b/toolsrc/include/vcpkg/dependencies.h index 76ff89e7a4f077..3cca364e7c4552 100644 --- a/toolsrc/include/vcpkg/dependencies.h +++ b/toolsrc/include/vcpkg/dependencies.h @@ -4,11 +4,7 @@ #include #include -#include #include -#include -#include -#include #include #include @@ -19,6 +15,21 @@ namespace vcpkg::Graphs struct Randomizer; } +namespace vcpkg::CMakeVars +{ + struct CMakeVarProvider; +} + +namespace vcpkg::PortFileProvider +{ + struct PortFileProvider; +} + +namespace vcpkg +{ + struct StatusParagraphs; +} + namespace vcpkg::Dependencies { enum class RequestType diff --git a/toolsrc/include/vcpkg/export.ifw.h b/toolsrc/include/vcpkg/export.ifw.h index b1573924ed987f..02d66e379d5cc2 100644 --- a/toolsrc/include/vcpkg/export.ifw.h +++ b/toolsrc/include/vcpkg/export.ifw.h @@ -1,11 +1,15 @@ #pragma once #include -#include #include #include +namespace vcpkg +{ + struct VcpkgPaths; +} + namespace vcpkg::Export::IFW { struct Options diff --git a/toolsrc/include/vcpkg/help.h b/toolsrc/include/vcpkg/help.h index 3e1ef381e41317..eadc9960e9e48f 100644 --- a/toolsrc/include/vcpkg/help.h +++ b/toolsrc/include/vcpkg/help.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include diff --git a/toolsrc/src/vcpkg/archives.cpp b/toolsrc/src/vcpkg/archives.cpp index c90706928eeea6..33edc8e83fffbb 100644 --- a/toolsrc/src/vcpkg/archives.cpp +++ b/toolsrc/src/vcpkg/archives.cpp @@ -3,6 +3,7 @@ #include #include #include +#include namespace vcpkg::Archives { diff --git a/toolsrc/src/vcpkg/buildenvironment.cpp b/toolsrc/src/vcpkg/buildenvironment.cpp index 09d84d0e88075b..2b63a16b508572 100644 --- a/toolsrc/src/vcpkg/buildenvironment.cpp +++ b/toolsrc/src/vcpkg/buildenvironment.cpp @@ -1,5 +1,6 @@ #include #include +#include namespace vcpkg { diff --git a/toolsrc/src/vcpkg/commands.ciclean.cpp b/toolsrc/src/vcpkg/commands.ciclean.cpp index 21ae756ed43294..9d3b396400e026 100644 --- a/toolsrc/src/vcpkg/commands.ciclean.cpp +++ b/toolsrc/src/vcpkg/commands.ciclean.cpp @@ -4,6 +4,7 @@ #include #include +#include using namespace vcpkg; diff --git a/toolsrc/src/vcpkg/commands.contact.cpp b/toolsrc/src/vcpkg/commands.contact.cpp index 2c8c7b1b2857b1..8478f394e88cce 100644 --- a/toolsrc/src/vcpkg/commands.contact.cpp +++ b/toolsrc/src/vcpkg/commands.contact.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include diff --git a/toolsrc/src/vcpkg/commands.create.cpp b/toolsrc/src/vcpkg/commands.create.cpp index a7cfbc9318e626..0b2133dd15c2bf 100644 --- a/toolsrc/src/vcpkg/commands.create.cpp +++ b/toolsrc/src/vcpkg/commands.create.cpp @@ -1,9 +1,11 @@ #include #include +#include #include #include #include +#include namespace vcpkg::Commands::Create { diff --git a/toolsrc/src/vcpkg/commands.fetch.cpp b/toolsrc/src/vcpkg/commands.fetch.cpp index e6e59a30c15c10..b4b80b3553e1b5 100644 --- a/toolsrc/src/vcpkg/commands.fetch.cpp +++ b/toolsrc/src/vcpkg/commands.fetch.cpp @@ -1,6 +1,8 @@ #include #include +#include +#include namespace vcpkg::Commands::Fetch { diff --git a/toolsrc/src/vcpkg/commands.hash.cpp b/toolsrc/src/vcpkg/commands.hash.cpp index 5ac5e8aa6d4f1a..3e9d151d127c8a 100644 --- a/toolsrc/src/vcpkg/commands.hash.cpp +++ b/toolsrc/src/vcpkg/commands.hash.cpp @@ -1,7 +1,10 @@ #include #include +#include #include +#include +#include namespace vcpkg::Commands::Hash { diff --git a/toolsrc/src/vcpkg/commands.integrate.cpp b/toolsrc/src/vcpkg/commands.integrate.cpp index 1aa7d58649bf57..0309f6242cf7da 100644 --- a/toolsrc/src/vcpkg/commands.integrate.cpp +++ b/toolsrc/src/vcpkg/commands.integrate.cpp @@ -9,6 +9,7 @@ #include #include #include +#include namespace vcpkg::Commands::Integrate { diff --git a/toolsrc/src/vcpkg/commands.porthistory.cpp b/toolsrc/src/vcpkg/commands.porthistory.cpp index 6f45e26ed0f115..9d353b6f330f37 100644 --- a/toolsrc/src/vcpkg/commands.porthistory.cpp +++ b/toolsrc/src/vcpkg/commands.porthistory.cpp @@ -5,6 +5,7 @@ #include #include #include +#include namespace vcpkg::Commands::PortHistory { diff --git a/toolsrc/src/vcpkg/commands.version.cpp b/toolsrc/src/vcpkg/commands.version.cpp index d366a42b83a85e..5fc77c738393e6 100644 --- a/toolsrc/src/vcpkg/commands.version.cpp +++ b/toolsrc/src/vcpkg/commands.version.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #define STRINGIFY(...) #__VA_ARGS__ #define MACRO_TO_STRING(X) STRINGIFY(X) diff --git a/toolsrc/src/vcpkg/commands.xvsinstances.cpp b/toolsrc/src/vcpkg/commands.xvsinstances.cpp index 4ad9744c90e557..bdc817c9c8b7cd 100644 --- a/toolsrc/src/vcpkg/commands.xvsinstances.cpp +++ b/toolsrc/src/vcpkg/commands.xvsinstances.cpp @@ -27,7 +27,7 @@ namespace vcpkg::Commands::X_VSInstances Checks::exit_success(VCPKG_LINE_INFO); #else - Util::unused(args, paths); + (void)(args, paths); Checks::exit_with_message(VCPKG_LINE_INFO, "This command is not supported on non-windows platforms."); #endif }