]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Clean up header includes
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 11 Aug 2019 17:54:33 +0000 (19:54 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 14 Aug 2019 19:42:34 +0000 (21:42 +0200)
* All headers should have system.hpp as their first #include.
* Removed unnecessary stdbool.h inclusions.
* Use C++ variants of headers when possible.

12 files changed:
src/Error.hpp
src/common_header.hpp
src/counters.hpp
src/hashutil.hpp
src/language.hpp
src/macroskip.hpp
src/manifest.hpp
src/result.hpp
src/system.hpp
src/unify.hpp
src/util.hpp
unittest/util.hpp

index 3d622f8a0f957dd7f09bfcb08ee3fe8e5621e25e..0e155e30fea4ed7fb937ad12d39d7f48f0a42736 100644 (file)
@@ -18,6 +18,8 @@
 
 #pragma once
 
+#include "system.hpp"
+
 #include <stdexcept>
 
 class Error : public std::runtime_error
index ae9af69ea9a7c0e08efc21c68437994c9831a1b9..f522eaf1d18933e84b2acf03b72fa9d02716543f 100644 (file)
@@ -18,6 +18,8 @@
 
 #pragma once
 
+#include "system.hpp"
+
 #include "compression.hpp"
 
 #include "third_party/xxhash.h"
index c2560b73ed4b4525fd1feec00f3c69b51a4aab40..22698e9ff96be7e7e66c8784546a22387c742cf4 100644 (file)
@@ -18,7 +18,9 @@
 
 #pragma once
 
-#include <stddef.h>
+#include "system.hpp"
+
+#include <cstddef>
 
 struct counters
 {
index 09112d1081219d7f896d07885e1f7badcd3c4d11..32ebeec2eed3e9e7d82528c210fed8c2c51069ce 100644 (file)
@@ -18,6 +18,8 @@
 
 #pragma once
 
+#include "system.hpp"
+
 #include "conf.hpp"
 #include "hash.hpp"
 
index 481d608ddb44925e44be035edce7fb270b4c48ea..83dd41802562bdaf27c5f4c70f39c0a92a20ff44 100644 (file)
@@ -18,7 +18,7 @@
 
 #pragma once
 
-#include <stdbool.h>
+#include "system.hpp"
 
 const char* language_for_file(const char* fname);
 const char* p_language_for_language(const char* language);
index d8dfc5281e12688c5f6dc0c2d4bcacde89611e99..6c5926a1dd0f40c78e48c70ddec9963443b48a5c 100644 (file)
@@ -18,7 +18,9 @@
 
 #pragma once
 
-#include <stdint.h>
+#include "system.hpp"
+
+#include <cstdint>
 
 // A Boyer-Moore-Horspool skip table used for searching for the strings
 // "__TIME__" and "__DATE__".
index 05dae1e85457996fd782c6f41b256193179d037d..f46270a3a6e27ac74faa262d9760b07df5bbe045 100644 (file)
@@ -18,6 +18,8 @@
 
 #pragma once
 
+#include "system.hpp"
+
 #include "conf.hpp"
 #include "hashutil.hpp"
 
index e9b0700d82964febb8e47716bcd4b7b546828292..98b4b49831f4e1c3092a10af006efe6af5c67d3b 100644 (file)
@@ -18,6 +18,8 @@
 
 #pragma once
 
+#include "system.hpp"
+
 #include "conf.hpp"
 
 extern const char RESULT_MAGIC[4];
index b331fbdb055aea7290118ce2a1e4ef6d09b509a6..cc19a3fa4789ed6195009d76802f0863c977d7f6 100644 (file)
 #  include <sys/wait.h>
 #endif
 
-#include <assert.h>
-#include <ctype.h>
+#include <cassert>
+#include <cctype>
+#include <cerrno>
+#include <cinttypes>
+#include <climits>
+#include <csignal>
+#include <cstdarg>
+#include <cstddef>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
 #include <dirent.h>
-#include <errno.h>
 #include <fcntl.h>
-#include <inttypes.h>
-#include <limits.h>
-#include <signal.h>
-#include <stdarg.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 #include <strings.h>
-#include <time.h>
 #include <unistd.h>
 #include <utime.h>
 
index 3629f693b355004bd740ea15ff286ee45f3e8067..5decc0af641400ecbfbd14152e9c6050bdc5f0c7 100644 (file)
@@ -18,6 +18,8 @@
 
 #pragma once
 
+#include "system.hpp"
+
 #include "hash.hpp"
 
 int unify_hash(struct hash* hash, const char* fname, bool print);
index 47536bca2c06f41b3cf10708ef258c850489301f..705bee41726782d829a672efde0c7402edd1d813 100644 (file)
@@ -16,6 +16,8 @@
 // this program; if not, write to the Free Software Foundation, Inc., 51
 // Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
+#include "system.hpp"
+
 #include <string>
 
 namespace util {
index 294483e35c53db3a5fec2c4baf6cf4c5c01b8fbe..57bf016de62e0cf84a2bf26d5d9d5c713be92b27 100644 (file)
@@ -18,7 +18,7 @@
 
 #pragma once
 
-#include <stdbool.h>
+#include "system.hpp"
 
 bool path_exists(const char* path);
 bool is_symlink(const char* path);