From 9a4f715d2b353492b118d0833bad6e506c4398cd Mon Sep 17 00:00:00 2001 From: Mihail Szabolcs Date: Sun, 18 Feb 2024 14:09:26 +0200 Subject: [PATCH] added missing include guards These changes make it easy to build an amalgamated `ninja.cc` that can be used to bootstrap ninja with just a working C++ compiler, without the need for any third-party tools like `cmake` or `python`. *nix c++ -O2 src/ninja_amalgamated.cc -o ninja osx-cross x86_64-apple-darwin19-c++ -O2 src/one.cc -o ninja mingw x86_64-w64-mingw32-c++ -O2 src/ninja_amalgamated.cc -o ninja.exe msvc cl.exe /nologo /Ox /GR- src\ninja_amalgamated.cc /out:ninja.exe --- src/includes_normalize.h | 5 +++++ src/msvc_helper.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/includes_normalize.h b/src/includes_normalize.h index 7d505564ad..8d29a64a93 100644 --- a/src/includes_normalize.h +++ b/src/includes_normalize.h @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +#ifndef INCLUDES_NORMALIZE_H_ +#define INCLUDES_NORMALIZE_H_ + #include #include @@ -38,3 +41,5 @@ struct IncludesNormalize { std::string relative_to_; std::vector split_relative_to_; }; + +#endif // INCLUDES_NORMALIZE_H_ diff --git a/src/msvc_helper.h b/src/msvc_helper.h index 568b9f94e5..699b0a132d 100644 --- a/src/msvc_helper.h +++ b/src/msvc_helper.h @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +#ifndef MSVC_HELPER_H_ +#define MSVC_HELPER_H_ + #include std::string EscapeForDepfile(const std::string& path); @@ -30,3 +33,5 @@ struct CLWrapper { void* env_block_; }; + +#endif // MSVC_HELPER_H_