summaryrefslogtreecommitdiff
path: root/Utilities
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2020-08-29 16:27:37 -0400
committerKyle Edwards <kyle.edwards@kitware.com>2020-09-03 09:30:21 -0400
commitbdca8b01d2d96d63e685e7eca03e0f51f5410fdf (patch)
treef7e14aa6967bd3981b0bff21c4f0e113de275fb3 /Utilities
parent093ba4061da68d8c86a09b3631767912ffb183e2 (diff)
downloadcmake-bdca8b01d2d96d63e685e7eca03e0f51f5410fdf.tar.gz
Modernize: Use #pragma once in all header files
#pragma once is a widely supported compiler pragma, even though it is not part of the C++ standard. Many of the issues keeping #pragma once from being standardized (distributed filesystems, build farms, hard links, etc.) do not apply to CMake - it is easy to build CMake on a single machine. CMake also does not install any header files which can be consumed by other projects (though cmCPluginAPI.h has been deliberately omitted from this conversion in case anyone is still using it.) Finally, #pragma once has been required to build CMake since at least August 2017 (7f29bbe6 enabled server mode unconditionally, which had been using #pragma once since September 2016 (b13d3e0d)). The fact that we now require C++11 filters out old compilers, and it is unlikely that there is a compiler which supports C++11 but does not support #pragma once.
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cm3p/Setup.Configuration.h5
-rw-r--r--Utilities/cm3p/archive.h5
-rw-r--r--Utilities/cm3p/archive_entry.h5
-rw-r--r--Utilities/cm3p/bzlib.h5
-rw-r--r--Utilities/cm3p/curl/curl.h5
-rw-r--r--Utilities/cm3p/expat.h5
-rw-r--r--Utilities/cm3p/json/reader.h5
-rw-r--r--Utilities/cm3p/json/value.h5
-rw-r--r--Utilities/cm3p/json/writer.h5
-rw-r--r--Utilities/cm3p/kwiml/abi.h5
-rw-r--r--Utilities/cm3p/kwiml/int.h5
-rw-r--r--Utilities/cm3p/lzma.h5
-rw-r--r--Utilities/cm3p/rhash.h5
-rw-r--r--Utilities/cm3p/uv.h5
-rw-r--r--Utilities/cm3p/zlib.h5
-rw-r--r--Utilities/cm3p/zstd.h5
-rw-r--r--Utilities/cmThirdParty.h.in5
-rw-r--r--Utilities/std/cm/algorithm5
-rw-r--r--Utilities/std/cm/bits/erase_if.hxx5
-rw-r--r--Utilities/std/cm/deque5
-rw-r--r--Utilities/std/cm/filesystem5
-rw-r--r--Utilities/std/cm/iomanip5
-rw-r--r--Utilities/std/cm/iterator5
-rw-r--r--Utilities/std/cm/list5
-rw-r--r--Utilities/std/cm/map5
-rw-r--r--Utilities/std/cm/memory5
-rw-r--r--Utilities/std/cm/optional5
-rw-r--r--Utilities/std/cm/set5
-rw-r--r--Utilities/std/cm/shared_mutex5
-rw-r--r--Utilities/std/cm/string5
-rw-r--r--Utilities/std/cm/string_view4
-rw-r--r--Utilities/std/cm/type_traits5
-rw-r--r--Utilities/std/cm/unordered_map5
-rw-r--r--Utilities/std/cm/unordered_set5
-rw-r--r--Utilities/std/cm/utility5
-rw-r--r--Utilities/std/cm/vector5
-rw-r--r--Utilities/std/cmSTL.hxx.in5
-rw-r--r--Utilities/std/cmext/algorithm5
-rw-r--r--Utilities/std/cmext/iterator5
-rw-r--r--Utilities/std/cmext/memory5
-rw-r--r--Utilities/std/cmext/string_view5
-rw-r--r--Utilities/std/cmext/type_traits5
42 files changed, 42 insertions, 167 deletions
diff --git a/Utilities/cm3p/Setup.Configuration.h b/Utilities/cm3p/Setup.Configuration.h
index a5cf0580aa..9f4190e4f5 100644
--- a/Utilities/cm3p/Setup.Configuration.h
+++ b/Utilities/cm3p/Setup.Configuration.h
@@ -1,8 +1,5 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm3p_Setup_Configuration_h
-#define cm3p_Setup_Configuration_h
+#pragma once
#include <cmvssetup/Setup.Configuration.h> // IWYU pragma: export
-
-#endif
diff --git a/Utilities/cm3p/archive.h b/Utilities/cm3p/archive.h
index 956b3ab708..a775400e4f 100644
--- a/Utilities/cm3p/archive.h
+++ b/Utilities/cm3p/archive.h
@@ -1,7 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm3p_archive_h
-#define cm3p_archive_h
+#pragma once
/* Use the libarchive configured for CMake. */
#include "cmThirdParty.h"
@@ -10,5 +9,3 @@
#else
# include <cmlibarchive/libarchive/archive.h> // IWYU pragma: export
#endif
-
-#endif
diff --git a/Utilities/cm3p/archive_entry.h b/Utilities/cm3p/archive_entry.h
index 230e87a0f1..0f8376c795 100644
--- a/Utilities/cm3p/archive_entry.h
+++ b/Utilities/cm3p/archive_entry.h
@@ -1,7 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm3p_archive_entry_h
-#define cm3p_archive_entry_h
+#pragma once
/* Use the libarchive configured for CMake. */
#include "cmThirdParty.h"
@@ -10,5 +9,3 @@
#else
# include <cmlibarchive/libarchive/archive_entry.h> // IWYU pragma: export
#endif
-
-#endif
diff --git a/Utilities/cm3p/bzlib.h b/Utilities/cm3p/bzlib.h
index 2a0f4dd625..c0eef0322d 100644
--- a/Utilities/cm3p/bzlib.h
+++ b/Utilities/cm3p/bzlib.h
@@ -1,7 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm3p_bzlib_h
-#define cm3p_bzlib_h
+#pragma once
/* Use the bzip2 library configured for CMake. */
#include "cmThirdParty.h"
@@ -10,5 +9,3 @@
#else
# include <cmbzip2/bzlib.h> // IWYU pragma: export
#endif
-
-#endif
diff --git a/Utilities/cm3p/curl/curl.h b/Utilities/cm3p/curl/curl.h
index 6e2b8229dc..272db8d9f3 100644
--- a/Utilities/cm3p/curl/curl.h
+++ b/Utilities/cm3p/curl/curl.h
@@ -1,7 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm3p_curl_curl_h
-#define cm3p_curl_curl_h
+#pragma once
/* Use the curl library configured for CMake. */
#include "cmThirdParty.h"
@@ -10,5 +9,3 @@
#else
# include <cmcurl/include/curl/curl.h> // IWYU pragma: export
#endif
-
-#endif
diff --git a/Utilities/cm3p/expat.h b/Utilities/cm3p/expat.h
index 32e6fd0fe9..bcf6195e43 100644
--- a/Utilities/cm3p/expat.h
+++ b/Utilities/cm3p/expat.h
@@ -1,7 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm3p_expat_h
-#define cm3p_expat_h
+#pragma once
/* Use the expat library configured for CMake. */
#include "cmThirdParty.h"
@@ -10,5 +9,3 @@
#else
# include <cmexpat/lib/expat.h> // IWYU pragma: export
#endif
-
-#endif
diff --git a/Utilities/cm3p/json/reader.h b/Utilities/cm3p/json/reader.h
index 0df09eea16..9fa8d2d779 100644
--- a/Utilities/cm3p/json/reader.h
+++ b/Utilities/cm3p/json/reader.h
@@ -1,7 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm3p_json_reader_h
-#define cm3p_json_reader_h
+#pragma once
/* Use the jsoncpp library configured for CMake. */
#include "cmThirdParty.h"
@@ -10,5 +9,3 @@
#else
# include <cmjsoncpp/include/json/reader.h> // IWYU pragma: export
#endif
-
-#endif
diff --git a/Utilities/cm3p/json/value.h b/Utilities/cm3p/json/value.h
index f59bed6d69..fc3b5f4a56 100644
--- a/Utilities/cm3p/json/value.h
+++ b/Utilities/cm3p/json/value.h
@@ -1,7 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm3p_json_value_h
-#define cm3p_json_value_h
+#pragma once
/* Use the jsoncpp library configured for CMake. */
#include "cmThirdParty.h"
@@ -10,5 +9,3 @@
#else
# include <cmjsoncpp/include/json/value.h> // IWYU pragma: export
#endif
-
-#endif
diff --git a/Utilities/cm3p/json/writer.h b/Utilities/cm3p/json/writer.h
index 7fcc3e242c..7ee1e43af2 100644
--- a/Utilities/cm3p/json/writer.h
+++ b/Utilities/cm3p/json/writer.h
@@ -1,7 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm3p_json_writer_h
-#define cm3p_json_writer_h
+#pragma once
/* Use the jsoncpp library configured for CMake. */
#include "cmThirdParty.h"
@@ -10,5 +9,3 @@
#else
# include <cmjsoncpp/include/json/writer.h> // IWYU pragma: export
#endif
-
-#endif
diff --git a/Utilities/cm3p/kwiml/abi.h b/Utilities/cm3p/kwiml/abi.h
index 6d0dedf565..8d5189a6dc 100644
--- a/Utilities/cm3p/kwiml/abi.h
+++ b/Utilities/cm3p/kwiml/abi.h
@@ -1,7 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm3p_kwiml_abi_h
-#define cm3p_kwiml_abi_h
+#pragma once
/* Use the KWIML library configured for CMake. */
#include "cmThirdParty.h"
@@ -10,5 +9,3 @@
#else
# include <KWIML/include/kwiml/abi.h> // IWYU pragma: export
#endif
-
-#endif
diff --git a/Utilities/cm3p/kwiml/int.h b/Utilities/cm3p/kwiml/int.h
index 4c7c23df13..2669df8358 100644
--- a/Utilities/cm3p/kwiml/int.h
+++ b/Utilities/cm3p/kwiml/int.h
@@ -1,7 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm3p_kwiml_int_h
-#define cm3p_kwiml_int_h
+#pragma once
/* Use the KWIML library configured for CMake. */
#include "cmThirdParty.h"
@@ -10,5 +9,3 @@
#else
# include <KWIML/include/kwiml/int.h> // IWYU pragma: export
#endif
-
-#endif
diff --git a/Utilities/cm3p/lzma.h b/Utilities/cm3p/lzma.h
index abfacf361f..7842f6bb45 100644
--- a/Utilities/cm3p/lzma.h
+++ b/Utilities/cm3p/lzma.h
@@ -1,7 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm3p_lzma_h
-#define cm3p_lzma_h
+#pragma once
/* Use the liblzma configured for CMake. */
#include "cmThirdParty.h"
@@ -10,5 +9,3 @@
#else
# include <cmliblzma/liblzma/api/lzma.h> // IWYU pragma: export
#endif
-
-#endif
diff --git a/Utilities/cm3p/rhash.h b/Utilities/cm3p/rhash.h
index 9d5e411048..58285574a4 100644
--- a/Utilities/cm3p/rhash.h
+++ b/Utilities/cm3p/rhash.h
@@ -1,7 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm3p_rhash_h
-#define cm3p_rhash_h
+#pragma once
/* Use the LibRHash library configured for CMake. */
#include "cmThirdParty.h"
@@ -10,5 +9,3 @@
#else
# include <cmlibrhash/librhash/rhash.h> // IWYU pragma: export
#endif
-
-#endif
diff --git a/Utilities/cm3p/uv.h b/Utilities/cm3p/uv.h
index 307a09fdb7..36a86b696a 100644
--- a/Utilities/cm3p/uv.h
+++ b/Utilities/cm3p/uv.h
@@ -1,7 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm3p_uv_h
-#define cm3p_uv_h
+#pragma once
/* Use the libuv library configured for CMake. */
#include "cmThirdParty.h"
@@ -10,5 +9,3 @@
#else
# include <cmlibuv/include/uv.h> // IWYU pragma: export
#endif
-
-#endif
diff --git a/Utilities/cm3p/zlib.h b/Utilities/cm3p/zlib.h
index fe7baeebed..6b82aa2115 100644
--- a/Utilities/cm3p/zlib.h
+++ b/Utilities/cm3p/zlib.h
@@ -1,7 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm3p_zlib_h
-#define cm3p_zlib_h
+#pragma once
/* Use the zlib library configured for CMake. */
#include "cmThirdParty.h"
@@ -10,5 +9,3 @@
#else
# include <cmzlib/zlib.h> // IWYU pragma: export
#endif
-
-#endif
diff --git a/Utilities/cm3p/zstd.h b/Utilities/cm3p/zstd.h
index 07cc3e4359..51972de342 100644
--- a/Utilities/cm3p/zstd.h
+++ b/Utilities/cm3p/zstd.h
@@ -1,7 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm3p_zstd_h
-#define cm3p_zstd_h
+#pragma once
/* Use the libzstd configured for CMake. */
#include "cmThirdParty.h"
@@ -10,5 +9,3 @@
#else
# include <cmzstd/lib/zstd.h> // IWYU pragma: export
#endif
-
-#endif
diff --git a/Utilities/cmThirdParty.h.in b/Utilities/cmThirdParty.h.in
index 1456e34c72..bd0edb7c3b 100644
--- a/Utilities/cmThirdParty.h.in
+++ b/Utilities/cmThirdParty.h.in
@@ -1,7 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cmThirdParty_h
-#define cmThirdParty_h
+#pragma once
/* Whether CMake is using its own utility libraries. */
#cmakedefine CMAKE_USE_SYSTEM_CURL
@@ -16,5 +15,3 @@
#cmakedefine CMAKE_USE_SYSTEM_LIBRHASH
#cmakedefine CMAKE_USE_SYSTEM_LIBUV
#cmakedefine CMAKE_USE_SYSTEM_ZSTD
-
-#endif
diff --git a/Utilities/std/cm/algorithm b/Utilities/std/cm/algorithm
index 8ade99cb72..93fe224c9f 100644
--- a/Utilities/std/cm/algorithm
+++ b/Utilities/std/cm/algorithm
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm_algorithm
-#define cm_algorithm
+#pragma once
#include <algorithm> // IWYU pragma: export
#include <cassert>
@@ -34,5 +33,3 @@ T const& clamp(T const& v, T const& lo, T const& hi, Comp comp)
#endif
} // namespace cm
-
-#endif
diff --git a/Utilities/std/cm/bits/erase_if.hxx b/Utilities/std/cm/bits/erase_if.hxx
index 8952fb589f..354b0c22b4 100644
--- a/Utilities/std/cm/bits/erase_if.hxx
+++ b/Utilities/std/cm/bits/erase_if.hxx
@@ -4,8 +4,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm_bits_erase_if_hxx
-#define cm_bits_erase_if_hxx
+#pragma once
namespace cm {
namespace internals {
@@ -25,5 +24,3 @@ void erase_if(Container& cont, Predicate pred)
} // namespace internals
} // namespace cm
-
-#endif
diff --git a/Utilities/std/cm/deque b/Utilities/std/cm/deque
index 4bb6725574..b7b6959da4 100644
--- a/Utilities/std/cm/deque
+++ b/Utilities/std/cm/deque
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm_deque
-#define cm_deque
+#pragma once
#include <algorithm>
#include <deque> // IWYU pragma: export
@@ -36,5 +35,3 @@ inline void erase_if(std::deque<T, Allocator>& cont, Predicate pred)
#endif
} // namespace cm
-
-#endif
diff --git a/Utilities/std/cm/filesystem b/Utilities/std/cm/filesystem
index 6021712a0d..cb05b22d52 100644
--- a/Utilities/std/cm/filesystem
+++ b/Utilities/std/cm/filesystem
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm_filesystem
-#define cm_filesystem
+#pragma once
#include "cmSTL.hxx" // IWYU pragma: keep
@@ -1171,5 +1170,3 @@ std::size_t hash_value(const path& p) noexcept;
} // namespace filesystem
} // namespace cm
-
-#endif
diff --git a/Utilities/std/cm/iomanip b/Utilities/std/cm/iomanip
index 6f68530c00..602b912581 100644
--- a/Utilities/std/cm/iomanip
+++ b/Utilities/std/cm/iomanip
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm_iomanip
-#define cm_iomanip
+#pragma once
#include <iomanip> // IWYU pragma: export
#if __cplusplus < 201402L || defined(_MSVC_LANG) && _MSVC_LANG < 201402L
@@ -179,5 +178,3 @@ inline internals::quoted_string<cm::string_view, char> quoted(
#endif
} // namespace cm
-
-#endif
diff --git a/Utilities/std/cm/iterator b/Utilities/std/cm/iterator
index 718f1d6306..3b38cc7925 100644
--- a/Utilities/std/cm/iterator
+++ b/Utilities/std/cm/iterator
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm_iterator
-#define cm_iterator
+#pragma once
#include <iterator> // IWYU pragma: export
@@ -212,5 +211,3 @@ constexpr T* data(T (&arr)[N]) noexcept
#endif
} // namespace cm
-
-#endif
diff --git a/Utilities/std/cm/list b/Utilities/std/cm/list
index ba5d94a081..380bff8d71 100644
--- a/Utilities/std/cm/list
+++ b/Utilities/std/cm/list
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm_list
-#define cm_list
+#pragma once
#include <list> // IWYU pragma: export
@@ -35,5 +34,3 @@ inline void erase_if(std::list<T, Allocator>& cont, Predicate pred)
#endif
} // namespace cm
-
-#endif
diff --git a/Utilities/std/cm/map b/Utilities/std/cm/map
index e348decff7..1794cd78db 100644
--- a/Utilities/std/cm/map
+++ b/Utilities/std/cm/map
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm_map
-#define cm_map
+#pragma once
#include <map> // IWYU pragma: export
@@ -40,5 +39,3 @@ inline void erase_if(std::multimap<Key, T, Compare, Allocator>& cont,
#endif
} // namespace cm
-
-#endif
diff --git a/Utilities/std/cm/memory b/Utilities/std/cm/memory
index 5611f6bb35..005e6e2954 100644
--- a/Utilities/std/cm/memory
+++ b/Utilities/std/cm/memory
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm_memory
-#define cm_memory
+#pragma once
#include "cmSTL.hxx" // IWYU pragma: keep
@@ -66,5 +65,3 @@ typename internals::make_unique_if<T>::bound_array make_unique(Args&&...) =
#endif
} // namespace cm
-
-#endif
diff --git a/Utilities/std/cm/optional b/Utilities/std/cm/optional
index 80b0951604..e691e8e1e9 100644
--- a/Utilities/std/cm/optional
+++ b/Utilities/std/cm/optional
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm_optional
-#define cm_optional
+#pragma once
#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
# define CMake_HAVE_CXX_OPTIONAL
@@ -340,5 +339,3 @@ T& optional<T>::emplace(Args&&... args)
#endif
}
-
-#endif
diff --git a/Utilities/std/cm/set b/Utilities/std/cm/set
index 56dd474c1a..9fd24d3d4f 100644
--- a/Utilities/std/cm/set
+++ b/Utilities/std/cm/set
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm_set
-#define cm_set
+#pragma once
#include <set> // IWYU pragma: export
@@ -39,5 +38,3 @@ inline void erase_if(std::multiset<Key, Compare, Allocator>& cont,
#endif
} // namespace cm
-
-#endif
diff --git a/Utilities/std/cm/shared_mutex b/Utilities/std/cm/shared_mutex
index ec63a7bc04..a1204fa557 100644
--- a/Utilities/std/cm/shared_mutex
+++ b/Utilities/std/cm/shared_mutex
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm_shared_mutex
-#define cm_shared_mutex
+#pragma once
#if __cplusplus >= 201402L || defined(_MSVC_LANG) && _MSVC_LANG >= 201402L
# define CMake_HAVE_CXX_SHARED_LOCK
@@ -72,5 +71,3 @@ public:
};
#endif
}
-
-#endif
diff --git a/Utilities/std/cm/string b/Utilities/std/cm/string
index cc4c796893..30b1b8565f 100644
--- a/Utilities/std/cm/string
+++ b/Utilities/std/cm/string
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm_string
-#define cm_string
+#pragma once
#include <algorithm>
#include <string> // IWYU pragma: export
@@ -38,5 +37,3 @@ inline void erase_if(std::basic_string<T, Traits, Allocator>& cont,
#endif
} // namespace cm
-
-#endif
diff --git a/Utilities/std/cm/string_view b/Utilities/std/cm/string_view
index 4d359cb5c3..9542bac352 100644
--- a/Utilities/std/cm/string_view
+++ b/Utilities/std/cm/string_view
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm_string_view
-#define cm_string_view
+#pragma once
#if __cplusplus >= 201703L || defined(_MSVC_LANG) && _MSVC_LANG >= 201703L
# define CMake_HAVE_CXX_STRING_VIEW
@@ -215,4 +214,3 @@ struct hash<cm::string_view>
}
#endif
-#endif
diff --git a/Utilities/std/cm/type_traits b/Utilities/std/cm/type_traits
index e32c2c676d..56ec64fe46 100644
--- a/Utilities/std/cm/type_traits
+++ b/Utilities/std/cm/type_traits
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm_type_traits
-#define cm_type_traits
+#pragma once
#include <type_traits> // IWYU pragma: export
@@ -59,5 +58,3 @@ using void_t = typename make_void<ArgTypes...>::type;
#endif
} // namespace cm
-
-#endif
diff --git a/Utilities/std/cm/unordered_map b/Utilities/std/cm/unordered_map
index 5b8a456fde..d21c37e2bf 100644
--- a/Utilities/std/cm/unordered_map
+++ b/Utilities/std/cm/unordered_map
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm_unordered_map
-#define cm_unordered_map
+#pragma once
#include <unordered_map> // IWYU pragma: export
@@ -41,5 +40,3 @@ inline void erase_if(
#endif
} // namespace cm
-
-#endif
diff --git a/Utilities/std/cm/unordered_set b/Utilities/std/cm/unordered_set
index 9debac43ff..2545ff6896 100644
--- a/Utilities/std/cm/unordered_set
+++ b/Utilities/std/cm/unordered_set
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm_unordered_set
-#define cm_unordered_set
+#pragma once
#include <unordered_set> // IWYU pragma: export
@@ -41,5 +40,3 @@ inline void erase_if(
#endif
} // namespace cm
-
-#endif
diff --git a/Utilities/std/cm/utility b/Utilities/std/cm/utility
index 3acac4f69d..c257fc8068 100644
--- a/Utilities/std/cm/utility
+++ b/Utilities/std/cm/utility
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm_utility
-#define cm_utility
+#pragma once
#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
# define CMake_HAVE_CXX_IN_PLACE
@@ -30,5 +29,3 @@ constexpr in_place_t in_place{};
#endif
}
-
-#endif
diff --git a/Utilities/std/cm/vector b/Utilities/std/cm/vector
index 2dbe704393..33d9365a7d 100644
--- a/Utilities/std/cm/vector
+++ b/Utilities/std/cm/vector
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm_vector
-#define cm_vector
+#pragma once
#include <algorithm>
#include <vector> // IWYU pragma: export
@@ -36,5 +35,3 @@ inline void erase_if(std::vector<T, Allocator>& cont, Predicate pred)
#endif
} // namespace cm
-
-#endif
diff --git a/Utilities/std/cmSTL.hxx.in b/Utilities/std/cmSTL.hxx.in
index 9c8605c83b..5e94864de5 100644
--- a/Utilities/std/cmSTL.hxx.in
+++ b/Utilities/std/cmSTL.hxx.in
@@ -1,10 +1,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cmSTL_hxx
-#define cmSTL_hxx
+#pragma once
/* Whether CMake is using its own STL implementation. */
#cmakedefine CMake_HAVE_CXX_MAKE_UNIQUE
#cmakedefine CMake_HAVE_CXX_FILESYSTEM
-
-#endif
diff --git a/Utilities/std/cmext/algorithm b/Utilities/std/cmext/algorithm
index 251c89a5fa..11514fcf7b 100644
--- a/Utilities/std/cmext/algorithm
+++ b/Utilities/std/cmext/algorithm
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cmext_algorithm
-#define cmext_algorithm
+#pragma once
#include <algorithm>
#include <iterator>
@@ -247,5 +246,3 @@ bool contains(Range const& range, Key const& key)
#endif
} // namespace cm
-
-#endif
diff --git a/Utilities/std/cmext/iterator b/Utilities/std/cmext/iterator
index ce9462f0a5..83d7890921 100644
--- a/Utilities/std/cmext/iterator
+++ b/Utilities/std/cmext/iterator
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cmext_iterator
-#define cmext_iterator
+#pragma once
#include <iterator>
@@ -47,5 +46,3 @@ using is_input_range =
#endif
} // namespace cm
-
-#endif
diff --git a/Utilities/std/cmext/memory b/Utilities/std/cmext/memory
index fa326f0e38..3681d97523 100644
--- a/Utilities/std/cmext/memory
+++ b/Utilities/std/cmext/memory
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cmext_memory
-#define cmext_memory
+#pragma once
#include <typeinfo>
@@ -37,5 +36,3 @@ T& dynamic_reference_cast(O& item)
}
} // namespace cm
-
-#endif
diff --git a/Utilities/std/cmext/string_view b/Utilities/std/cmext/string_view
index ad52b115a0..369cc90dc1 100644
--- a/Utilities/std/cmext/string_view
+++ b/Utilities/std/cmext/string_view
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cmext_string_view
-#define cmext_string_view
+#pragma once
#include <cstddef>
@@ -38,5 +37,3 @@ inline static_string_view operator"" _s(const char* data, size_t size)
} // namespace cm
using cm::operator"" _s;
-
-#endif
diff --git a/Utilities/std/cmext/type_traits b/Utilities/std/cmext/type_traits
index f02b4884e7..4468e3106d 100644
--- a/Utilities/std/cmext/type_traits
+++ b/Utilities/std/cmext/type_traits
@@ -3,8 +3,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cmext_type_traits
-#define cmext_type_traits
+#pragma once
#include <memory>
@@ -84,5 +83,3 @@ using is_sequence_container =
!cm::is_unordered_associative_container<T>::value>;
} // namespace cm
-
-#endif