]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Split ccache.hpp into per-.cpp file headers
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 22 Jan 2020 21:03:09 +0000 (22:03 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 22 Jan 2020 21:03:09 +0000 (22:03 +0100)
This reduces code dependencies that hamper refactoring.

45 files changed:
dev.mk.in
src/AtomicFile.cpp
src/Config.cpp
src/Config.hpp
src/Stat.cpp
src/Util.cpp
src/ZstdCompressor.cpp
src/ZstdDecompressor.hpp
src/args.cpp
src/args.hpp [new file with mode: 0644]
src/ccache.cpp
src/ccache.hpp
src/cleanup.cpp
src/compopt.cpp
src/compress.cpp
src/counters.cpp
src/execute.cpp
src/execute.hpp [new file with mode: 0644]
src/exitfn.cpp
src/exitfn.hpp [new file with mode: 0644]
src/hash.cpp
src/hashutil.cpp
src/language.cpp
src/legacy_util.cpp
src/legacy_util.hpp [new file with mode: 0644]
src/lockfile.cpp
src/lockfile.hpp [new file with mode: 0644]
src/manifest.cpp
src/result.cpp
src/stats.cpp
src/stats.hpp [new file with mode: 0644]
src/system.hpp
unittest/framework.cpp
unittest/framework.hpp
unittest/main.cpp
unittest/test_Stat.cpp
unittest/test_args.cpp
unittest/test_argument_processing.cpp
unittest/test_compopt.cpp
unittest/test_counters.cpp
unittest/test_hash.cpp
unittest/test_hashutil.cpp
unittest/test_legacy_util.cpp
unittest/test_lockfile.cpp
unittest/test_stats.cpp

index d86984c064323024d7a6b3261a2c09da21bd6667..2e8b5386af679acbcf8b31149c298639da350480 100644 (file)
--- a/dev.mk.in
+++ b/dev.mk.in
@@ -56,17 +56,23 @@ non_third_party_headers = \
     src/Util.hpp \
     src/ZstdCompressor.hpp \
     src/ZstdDecompressor.hpp \
+    src/args.hpp \
     src/ccache.hpp \
     src/cleanup.hpp \
     src/compopt.hpp \
     src/compress.hpp \
     src/counters.hpp \
+    src/execute.hpp \
+    src/exitfn.hpp \
     src/hash.hpp \
     src/hashutil.hpp \
     src/language.hpp \
+    src/legacy_util.hpp \
+    src/lockfile.hpp \
     src/macroskip.hpp \
     src/manifest.hpp \
     src/result.hpp \
+    src/stats.hpp \
     src/system.hpp \
     unittest/framework.hpp \
     unittest/util.hpp
index 9ad351764407f3b041c7cfbf1528dcda82948001..9dad3a3924d520e32e356b52512a7cd12f7e17f6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2019 Joel Rosdahl and other contributors
+// Copyright (C) 2019-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -20,7 +20,6 @@
 
 #include "Error.hpp"
 #include "Util.hpp"
-#include "ccache.hpp"
 
 #include "third_party/fmt/core.h"
 
index 7d3883abf3f6580445cacc0db3800c6920c9a783..34ee5899c79a704d4afe246a8ef6a0b9e8f38ff8 100644 (file)
@@ -21,6 +21,7 @@
 #include "AtomicFile.hpp"
 #include "Error.hpp"
 #include "Util.hpp"
+#include "ccache.hpp"
 
 #include <algorithm>
 #include <cassert>
index 82a06501d8641e600cc2923fe20ddf8fb6e92e7c..2b8bb77d02ed5250eca7e0d9075bee5b60348bbe 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "system.hpp"
 
-#include "ccache.hpp"
+#include "legacy_util.hpp"
 
 #include "third_party/fmt/core.h"
 #include "third_party/nonstd/optional.hpp"
index ebb47a0990b7b4ddacdd530764b39090e105d9cc..c8b750afee30a9e9e3925fe2adfb32bbda421a77 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2019 Joel Rosdahl and other contributors
+// Copyright (C) 2019-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -18,7 +18,7 @@
 
 #include "Stat.hpp"
 
-#include "ccache.hpp"
+#include "legacy_util.hpp"
 
 #include "third_party/fmt/core.h"
 
index 7edde7342fd2dff092a6a1ba376278eb88425f97..ab0d7abb6382069f32c86a688d79abdd4c4d43bb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2019 Joel Rosdahl and other contributors
+// Copyright (C) 2019-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -20,7 +20,6 @@
 
 #include "Config.hpp"
 #include "FormatNonstdStringView.hpp"
-#include "ccache.hpp"
 
 #include <algorithm>
 #include <fstream>
index e3342b4fa4b6a93f0af16c2ec840d56227733fe0..424f9ba7fa07518a8d6e1fcca7339c09b4c59caf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2019 Joel Rosdahl and other contributors
+// Copyright (C) 2019-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -19,7 +19,7 @@
 #include "ZstdCompressor.hpp"
 
 #include "Error.hpp"
-#include "ccache.hpp"
+#include "legacy_util.hpp"
 
 const uint8_t k_default_zstd_compression_level = -1;
 
index b32f006f3d36a49e117a1157d99dff68cf8f59f5..8f85ce68ab7eeeba02a9071ac93c4424a88598ba 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2019 Joel Rosdahl and other contributors
+// Copyright (C) 2019-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -21,7 +21,6 @@
 #include "system.hpp"
 
 #include "Decompressor.hpp"
-#include "ccache.hpp"
 
 #include <fstream>
 #include <zstd.h>
index deb4309dc24fc37c5e1c21f91d262afc3a3d0a6a..78313d1268d3ada93db375584d3c00187876d492 100644 (file)
@@ -1,5 +1,5 @@
 // Copyright (C) 2002 Andrew Tridgell
-// Copyright (C) 2009-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2009-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -17,7 +17,9 @@
 // this program; if not, write to the Free Software Foundation, Inc., 51
 // Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
-#include "ccache.hpp"
+#include "args.hpp"
+
+#include "legacy_util.hpp"
 
 struct args*
 args_init(int init_argc, const char* const* init_args)
diff --git a/src/args.hpp b/src/args.hpp
new file mode 100644 (file)
index 0000000..994ae35
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (C) 2020 Joel Rosdahl and other contributors
+//
+// See doc/AUTHORS.adoc for a complete list of contributors.
+//
+// This program is free software; you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3 of the License, or (at your option)
+// any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+// more details.
+//
+// You should have received a copy of the GNU General Public License along with
+// this program; if not, write to the Free Software Foundation, Inc., 51
+// Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+#pragma once
+
+struct args
+{
+  char** argv;
+  int argc;
+};
+
+struct args* args_init(int, const char* const*);
+struct args* args_init_from_string(const char*);
+struct args* args_init_from_gcc_atfile(const char* filename);
+struct args* args_copy(struct args* args);
+void args_free(struct args* args);
+void args_add(struct args* args, const char* s);
+void args_add_prefix(struct args* args, const char* s);
+void args_extend(struct args* args, struct args* to_append);
+void args_insert(struct args* dest, int index, struct args* src, bool replace);
+void args_pop(struct args* args, int n);
+void args_set(struct args* args, int index, const char* value);
+void args_strip(struct args* args, const char* prefix);
+void args_remove_first(struct args* args);
+char* args_to_string(const struct args* args);
+bool args_equal(const struct args* args1, const struct args* args2);
index 87436cbf97a9f3f6753c1df9d6eaf34d9e62db92..efec49f06d71847d3fbd4c6e29c0f69884bcc236 100644 (file)
 #include "FormatNonstdStringView.hpp"
 #include "ProgressBar.hpp"
 #include "Util.hpp"
+#include "args.hpp"
 #include "cleanup.hpp"
 #include "compopt.hpp"
 #include "compress.hpp"
+#include "execute.hpp"
+#include "exitfn.hpp"
 #include "hash.hpp"
 #include "hashutil.hpp"
 #include "language.hpp"
 #include "manifest.hpp"
 #include "result.hpp"
+#include "stats.hpp"
 
 #include "third_party/fmt/core.h"
+#include "third_party/minitrace.h"
 
 #ifdef HAVE_GETOPT_LONG
 #  include <getopt.h>
@@ -43,6 +48,9 @@
 #include <fstream>
 #include <limits>
 
+#define STRINGIFY(x) #x
+#define TO_STRING(x) STRINGIFY(x)
+
 using nonstd::string_view;
 
 // Global variables used by other compilation units.
@@ -278,11 +286,11 @@ static const int k_tempdir_cleanup_interval = 2 * 24 * 60 * 60; // 2 days
 
 #ifndef _WIN32
 static sigset_t fatal_signal_set;
+#endif
 
 // PID of currently executing compiler that we have started, if any. 0 means no
-// ongoing compilation.
+// ongoing compilation. Not used in the _WIN32 case.
 static pid_t compiler_pid = 0;
-#endif
 
 // This is a string that identifies the current "version" of the hash sum
 // computed by ccache. If, for any reason, we want to force the hash sum to be
index 7c201c4fa6afa53834e0a1094447457dce1f6af7..8b750eb49734df3e4c5d5bba71405579a4d83f79 100644 (file)
 
 #include "counters.hpp"
 
-#include "third_party/minitrace.h"
-
-#ifdef __GNUC__
-#  define ATTR_FORMAT(x, y, z)                                                 \
-    __attribute__((format(ATTRIBUTE_FORMAT_PRINTF, y, z)))
-#  define ATTR_NORETURN __attribute__((noreturn))
-#else
-#  define ATTR_FORMAT(x, y, z)
-#  define ATTR_NORETURN
-#endif
-
 #ifndef MYNAME
 #  define MYNAME "ccache"
 #endif
 
-#define STRINGIFY(x) #x
-#define TO_STRING(x) STRINGIFY(x)
-
 extern const char CCACHE_VERSION[];
 
-// Statistics fields in storage order.
-enum stats {
-  STATS_NONE = 0,
-  STATS_STDOUT = 1,
-  STATS_STATUS = 2,
-  STATS_ERROR = 3,
-  STATS_CACHEMISS = 4,
-  STATS_PREPROCESSOR = 5,
-  STATS_COMPILER = 6,
-  STATS_MISSING = 7,
-  STATS_CACHEHIT_CPP = 8,
-  STATS_ARGS = 9,
-  STATS_LINK = 10,
-  STATS_NUMFILES = 11,
-  STATS_TOTALSIZE = 12,
-  STATS_OBSOLETE_MAXFILES = 13,
-  STATS_OBSOLETE_MAXSIZE = 14,
-  STATS_SOURCELANG = 15,
-  STATS_BADOUTPUTFILE = 16,
-  STATS_NOINPUT = 17,
-  STATS_MULTIPLE = 18,
-  STATS_CONFTEST = 19,
-  STATS_UNSUPPORTED_OPTION = 20,
-  STATS_OUTSTDOUT = 21,
-  STATS_CACHEHIT_DIR = 22,
-  STATS_NOOUTPUT = 23,
-  STATS_EMPTYOUTPUT = 24,
-  STATS_BADEXTRAFILE = 25,
-  STATS_COMPCHECK = 26,
-  STATS_CANTUSEPCH = 27,
-  STATS_PREPROCESSING = 28,
-  STATS_NUMCLEANUPS = 29,
-  STATS_UNSUPPORTED_DIRECTIVE = 30,
-  STATS_ZEROTIMESTAMP = 31,
-  STATS_CANTUSEMODULES = 32,
-
-  STATS_END
-};
-
 enum guessed_compiler {
   GUESSED_CLANG,
   GUESSED_GCC,
@@ -112,178 +59,13 @@ extern enum guessed_compiler guessed_compiler;
 // Allow caching even if -fmodules is used.
 #define SLOPPY_MODULES (1U << 9)
 
-#define str_eq(s1, s2) (strcmp((s1), (s2)) == 0)
-#define str_startswith(s, prefix)                                              \
-  (strncmp((s), (prefix), strlen((prefix))) == 0)
-#define str_endswith(s, suffix)                                                \
-  (strlen(s) >= strlen(suffix)                                                 \
-   && str_eq((s) + strlen(s) - strlen(suffix), (suffix)))
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
-
-// Buffer size for I/O operations. Should be a multiple of 4 KiB.
-#define READ_BUFFER_SIZE 65536
-
-class Config;
-
-// ----------------------------------------------------------------------------
-// args.c
-
-struct args
-{
-  char** argv;
-  int argc;
-};
-
-struct args* args_init(int, const char* const*);
-struct args* args_init_from_string(const char*);
-struct args* args_init_from_gcc_atfile(const char* filename);
-struct args* args_copy(struct args* args);
-void args_free(struct args* args);
-void args_add(struct args* args, const char* s);
-void args_add_prefix(struct args* args, const char* s);
-void args_extend(struct args* args, struct args* to_append);
-void args_insert(struct args* dest, int index, struct args* src, bool replace);
-void args_pop(struct args* args, int n);
-void args_set(struct args* args, int index, const char* value);
-void args_strip(struct args* args, const char* prefix);
-void args_remove_first(struct args* args);
-char* args_to_string(const struct args* args);
-bool args_equal(const struct args* args1, const struct args* args2);
-
-// ----------------------------------------------------------------------------
-// legacy_util.c
-
-void cc_log(const char* format, ...) ATTR_FORMAT(printf, 1, 2);
-void cc_bulklog(const char* format, ...) ATTR_FORMAT(printf, 1, 2);
-void cc_log_argv(const char* prefix, char** argv);
-void cc_dump_debug_log_buffer(const char* path);
-void fatal(const char* format, ...) ATTR_FORMAT(printf, 1, 2) ATTR_NORETURN;
-void warn(const char* format, ...) ATTR_FORMAT(printf, 1, 2);
-
-bool copy_fd(int fd_in, int fd_out);
-bool clone_file(const char* src, const char* dest, bool via_tmp_file);
-bool copy_file(const char* src, const char* dest, bool via_tmp_file);
-bool move_file(const char* src, const char* dest);
-const char* get_hostname(void);
-const char* tmp_string(void);
-char* format(const char* format, ...) ATTR_FORMAT(printf, 1, 2);
-void format_hex(const uint8_t* data, size_t size, char* buffer);
-void reformat(char** ptr, const char* format, ...) ATTR_FORMAT(printf, 2, 3);
-char* x_strdup(const char* s);
-char* x_strndup(const char* s, size_t n);
-void* x_malloc(size_t size);
-void* x_realloc(void* ptr, size_t size);
-void x_setenv(const char* name, const char* value);
-void x_unsetenv(const char* name);
-char* x_dirname(const char* path);
-const char* get_extension(const char* path);
-char* format_human_readable_size(uint64_t size);
-char* format_parsable_size_with_suffix(uint64_t size);
-bool parse_size_with_suffix(const char* str, uint64_t* size);
-char* x_realpath(const char* path);
-char* gnu_getcwd(void);
-#ifndef HAVE_LOCALTIME_R
-struct tm* localtime_r(const time_t* timep, struct tm* result);
-#endif
-#ifndef HAVE_STRTOK_R
-char* strtok_r(char* str, const char* delim, char** saveptr);
-#endif
-int create_tmp_fd(char** fname);
-FILE* create_tmp_file(char** fname, const char* mode);
-const char* get_home_directory(void);
-char* get_cwd(void);
-bool same_executable_name(const char* s1, const char* s2);
-size_t common_dir_prefix_length(const char* s1, const char* s2);
-char* get_relative_path(const char* from, const char* to);
-bool is_absolute_path(const char* path);
-bool is_full_path(const char* path);
-void update_mtime(const char* path);
-void x_exit(int status) ATTR_NORETURN;
-int x_rename(const char* oldpath, const char* newpath);
-int tmp_unlink(const char* path);
-int x_unlink(const char* path);
-int x_try_unlink(const char* path);
-#ifndef _WIN32
-char* x_readlink(const char* path);
-#endif
-bool read_file(const char* path, size_t size_hint, char** data, size_t* size);
-char* read_text_file(const char* path, size_t size_hint);
-char* subst_env_in_string(const char* str, char** errmsg);
-void set_cloexec_flag(int fd);
-double time_seconds(void);
-
-// ----------------------------------------------------------------------------
-// stats.c
-
-void stats_update(enum stats stat);
-void stats_flush(void);
-unsigned stats_get_pending(enum stats stat);
-void stats_zero(void);
-void stats_summary(void);
-void stats_print(void);
-void stats_update_size(const char* sfile, int64_t size, int files);
-void stats_get_obsolete_limits(const char* dir,
-                               unsigned* maxfiles,
-                               uint64_t* maxsize);
-void stats_set_sizes(const char* dir, unsigned num_files, uint64_t total_size);
-void stats_add_cleanup(const char* dir, unsigned count);
-void stats_timestamp(time_t time, struct counters* counters);
-void stats_read(const char* path, struct counters* counters);
-void stats_write(const char* path, struct counters* counters);
-
-// ----------------------------------------------------------------------------
-// exitfn.c
-
-void exitfn_init(void);
-void exitfn_add_nullary(void (*function)(void));
-void exitfn_add(void (*function)(void*), void* context);
-void exitfn_add_last(void (*function)(void*), void* context);
-void exitfn_call(void);
-
-// ----------------------------------------------------------------------------
-// execute.c
-
-int execute(char** argv, int fd_out, int fd_err, pid_t* pid);
-char* find_executable(const char* name, const char* exclude_name);
-void print_command(FILE* fp, char** argv);
-char* format_command(const char* const* argv);
-
-// ----------------------------------------------------------------------------
-// lockfile.c
-
-bool lockfile_acquire(const char* path, unsigned staleness_limit);
-void lockfile_release(const char* path);
-
-// ----------------------------------------------------------------------------
-// ccache.c
-
 extern time_t time_of_compilation;
 extern bool output_is_precompiled_header;
-void block_signals(void);
-void unblock_signals(void);
+void block_signals();
+void unblock_signals();
 bool cc_process_args(struct args* args,
                      struct args** preprocessor_args,
                      struct args** extra_args_to_hash,
                      struct args** compiler_args);
-void cc_reset(void);
+void cc_reset();
 bool is_precompiled_header(const char* path);
-
-// ----------------------------------------------------------------------------
-
-// Work with silly DOS binary open.
-#ifndef O_BINARY
-#  define O_BINARY 0
-#endif
-
-#ifdef _WIN32
-char* win32argvtos(char* prefix, char** argv, int* length);
-char* win32getshell(char* path);
-int win32execute(
-  char* path, char** argv, int doreturn, int fd_stdout, int fd_stderr);
-void add_exe_ext_if_no_to_fullpath(char* full_path_win_ext,
-                                   size_t max_size,
-                                   const char* ext,
-                                   const char* path);
-
-#  define execute(a, b, c, d) win32execute(*(a), a, 1, b, c)
-#endif
index b00ca2f9afe48929a1efa0d22f1affabc387ec6e..318f2ee5ccdaa026b5311e74c92fecbe3a7e3fc6 100644 (file)
@@ -1,5 +1,5 @@
 // Copyright (C) 2002-2006 Andrew Tridgell
-// Copyright (C) 2009-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2009-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -21,7 +21,7 @@
 
 #include "CacheFile.hpp"
 #include "Config.hpp"
-#include "ccache.hpp"
+#include "stats.hpp"
 
 #include <algorithm>
 #include <math.h>
index 61a8888cfc3ee3c8a0a0b20d9305efbe7e0dda2f..885cfa0236a03802f821c3774ab1b04c99484c44 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2010-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -18,7 +18,7 @@
 
 #include "compopt.hpp"
 
-#include "ccache.hpp"
+#include "legacy_util.hpp"
 
 // The option it too hard to handle at all.
 #define TOO_HARD (1 << 0)
index dd493e9f3c8acea6743af6aa478d4d6cfae4016d..a1cf5b08e2a29292c58010d7ca7d3427a77ff846 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2019 Joel Rosdahl and other contributors
+// Copyright (C) 2019-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -26,6 +26,7 @@
 #include "ThreadPool.hpp"
 #include "manifest.hpp"
 #include "result.hpp"
+#include "stats.hpp"
 
 #include "third_party/fmt/core.h"
 
index ade493c26513622c32a7c1bd8fe735c2b427d252..2de240814871d942843840ef549b489ddf1f4da3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2010-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -18,7 +18,9 @@
 
 // A simple array of unsigned integers used for the statistics counters.
 
-#include "ccache.hpp"
+#include "counters.hpp"
+
+#include "legacy_util.hpp"
 
 // Allocate and initialize a struct counters. Data entries up to the size are
 // set to 0.
index faac80a24b462acccfb6f38fdb203786da5ad5b2..7ab4c0d47138eb63b79f8d2ed6dbfce79cf567b2 100644 (file)
@@ -1,5 +1,5 @@
 // Copyright (C) 2002 Andrew Tridgell
-// Copyright (C) 2011-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2011-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -17,6 +17,8 @@
 // this program; if not, write to the Free Software Foundation, Inc., 51
 // Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
+#include "execute.hpp"
+
 #include "Config.hpp"
 #include "Stat.hpp"
 #include "Util.hpp"
@@ -29,6 +31,12 @@ static char* find_executable_in_path(const char* name,
                                      const char* path);
 
 #ifdef _WIN32
+int
+execute(char** argv, int fd_out, int fd_err, pid_t* /*pid*/)
+{
+  return win32execute(argv[0], argv, 1, fd_out, fd_err);
+}
+
 // Re-create a win32 command line string based on **argv.
 // http://msdn.microsoft.com/en-us/library/17w5ykft.aspx
 char*
diff --git a/src/execute.hpp b/src/execute.hpp
new file mode 100644 (file)
index 0000000..4e31f38
--- /dev/null
@@ -0,0 +1,26 @@
+// Copyright (C) 2020 Joel Rosdahl and other contributors
+//
+// See doc/AUTHORS.adoc for a complete list of contributors.
+//
+// This program is free software; you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3 of the License, or (at your option)
+// any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+// more details.
+//
+// You should have received a copy of the GNU General Public License along with
+// this program; if not, write to the Free Software Foundation, Inc., 51
+// Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+#pragma once
+
+#include "system.hpp"
+
+int execute(char** argv, int fd_out, int fd_err, pid_t* pid);
+char* find_executable(const char* name, const char* exclude_name);
+void print_command(FILE* fp, char** argv);
+char* format_command(const char* const* argv);
index 32dfbdfae4d68b43008267e48fc473466947cf8a..ea7d2e68dfb7ccf104583fef7229139caa25053e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2010-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -16,7 +16,9 @@
 // this program; if not, write to the Free Software Foundation, Inc., 51
 // Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
-#include "ccache.hpp"
+#include "exitfn.hpp"
+
+#include "legacy_util.hpp"
 
 struct exit_function
 {
diff --git a/src/exitfn.hpp b/src/exitfn.hpp
new file mode 100644 (file)
index 0000000..c8ad838
--- /dev/null
@@ -0,0 +1,25 @@
+// Copyright (C) 2020 Joel Rosdahl and other contributors
+//
+// See doc/AUTHORS.adoc for a complete list of contributors.
+//
+// This program is free software; you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3 of the License, or (at your option)
+// any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+// more details.
+//
+// You should have received a copy of the GNU General Public License along with
+// this program; if not, write to the Free Software Foundation, Inc., 51
+// Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+#pragma once
+
+void exitfn_init();
+void exitfn_add_nullary(void (*function)());
+void exitfn_add(void (*function)(void*), void* context);
+void exitfn_add_last(void (*function)(void*), void* context);
+void exitfn_call();
index f839287d26a913ddc5525e4322136bd74b50d20f..4e3c76f5179e49bbbee6fe5b8cba7cecf7fbd298 100644 (file)
@@ -1,5 +1,5 @@
 // Copyright (C) 2002 Andrew Tridgell
-// Copyright (C) 2010-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2010-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -19,7 +19,7 @@
 
 #include "hash.hpp"
 
-#include "ccache.hpp"
+#include "legacy_util.hpp"
 
 #include <blake2.h>
 
index a091225d76bce9d93ff47e25d8e3288899aee2f8..44eacdf155d30c9c6f2b2567c987c232b7c210f9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2009-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
 #include "hashutil.hpp"
 
 #include "Stat.hpp"
+#include "args.hpp"
 #include "ccache.hpp"
+#include "execute.hpp"
 #include "macroskip.hpp"
+#include "stats.hpp"
 
 #include "third_party/xxhash.h"
 
index bfffa2000626c8b40fb9e54aa63f12471bbcde00..df8b9d4eb6680254285a53eb854f40caaae3f371 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2010-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -18,7 +18,7 @@
 
 #include "language.hpp"
 
-#include "ccache.hpp"
+#include "legacy_util.hpp"
 
 // Supported file extensions and corresponding languages (as in parameter to
 // the -x option).
index 5273debd119530201466730896099b3dee87d278..b767ad84eb3e1e8fe687d46764628b2fcff7adc5 100644 (file)
@@ -1,5 +1,5 @@
 // Copyright (C) 2002 Andrew Tridgell
-// Copyright (C) 2009-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2009-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -20,7 +20,7 @@
 #include "Config.hpp"
 #include "Error.hpp"
 #include "Util.hpp"
-#include "ccache.hpp"
+#include "execute.hpp"
 
 #include "third_party/fmt/core.h"
 
diff --git a/src/legacy_util.hpp b/src/legacy_util.hpp
new file mode 100644 (file)
index 0000000..d6069b3
--- /dev/null
@@ -0,0 +1,80 @@
+// Copyright (C) 2020 Joel Rosdahl and other contributors
+//
+// See doc/AUTHORS.adoc for a complete list of contributors.
+//
+// This program is free software; you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3 of the License, or (at your option)
+// any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+// more details.
+//
+// You should have received a copy of the GNU General Public License along with
+// this program; if not, write to the Free Software Foundation, Inc., 51
+// Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+#pragma once
+
+#include "system.hpp"
+
+void cc_log(const char* format, ...) ATTR_FORMAT(printf, 1, 2);
+void cc_bulklog(const char* format, ...) ATTR_FORMAT(printf, 1, 2);
+void cc_log_argv(const char* prefix, char** argv);
+void cc_dump_debug_log_buffer(const char* path);
+void fatal(const char* format, ...) ATTR_FORMAT(printf, 1, 2) ATTR_NORETURN;
+void warn(const char* format, ...) ATTR_FORMAT(printf, 1, 2);
+
+bool copy_fd(int fd_in, int fd_out);
+bool clone_file(const char* src, const char* dest, bool via_tmp_file);
+bool copy_file(const char* src, const char* dest, bool via_tmp_file);
+bool move_file(const char* src, const char* dest);
+const char* get_hostname();
+const char* tmp_string();
+char* format(const char* format, ...) ATTR_FORMAT(printf, 1, 2);
+void format_hex(const uint8_t* data, size_t size, char* buffer);
+void reformat(char** ptr, const char* format, ...) ATTR_FORMAT(printf, 2, 3);
+char* x_strdup(const char* s);
+char* x_strndup(const char* s, size_t n);
+void* x_malloc(size_t size);
+void* x_realloc(void* ptr, size_t size);
+void x_setenv(const char* name, const char* value);
+void x_unsetenv(const char* name);
+char* x_dirname(const char* path);
+const char* get_extension(const char* path);
+char* format_human_readable_size(uint64_t size);
+char* format_parsable_size_with_suffix(uint64_t size);
+bool parse_size_with_suffix(const char* str, uint64_t* size);
+char* x_realpath(const char* path);
+char* gnu_getcwd();
+#ifndef HAVE_LOCALTIME_R
+struct tm* localtime_r(const time_t* timep, struct tm* result);
+#endif
+#ifndef HAVE_STRTOK_R
+char* strtok_r(char* str, const char* delim, char** saveptr);
+#endif
+int create_tmp_fd(char** fname);
+FILE* create_tmp_file(char** fname, const char* mode);
+const char* get_home_directory();
+char* get_cwd();
+bool same_executable_name(const char* s1, const char* s2);
+size_t common_dir_prefix_length(const char* s1, const char* s2);
+char* get_relative_path(const char* from, const char* to);
+bool is_absolute_path(const char* path);
+bool is_full_path(const char* path);
+void update_mtime(const char* path);
+void x_exit(int status) ATTR_NORETURN;
+int x_rename(const char* oldpath, const char* newpath);
+int tmp_unlink(const char* path);
+int x_unlink(const char* path);
+int x_try_unlink(const char* path);
+#ifndef _WIN32
+char* x_readlink(const char* path);
+#endif
+bool read_file(const char* path, size_t size_hint, char** data, size_t* size);
+char* read_text_file(const char* path, size_t size_hint);
+char* subst_env_in_string(const char* str, char** errmsg);
+void set_cloexec_flag(int fd);
+double time_seconds();
index a93be8e339fcce66bfa2b55d95b9718a320c18f7..ce3029cf7c82ff0fc72f858f6fb38202abea02eb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2010-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -16,8 +16,9 @@
 // this program; if not, write to the Free Software Foundation, Inc., 51
 // Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
+#include "lockfile.hpp"
+
 #include "Util.hpp"
-#include "ccache.hpp"
 
 // This function acquires a lockfile for the given path. Returns true if the
 // lock was acquired, otherwise false. If the lock has been considered stale
diff --git a/src/lockfile.hpp b/src/lockfile.hpp
new file mode 100644 (file)
index 0000000..275c7a0
--- /dev/null
@@ -0,0 +1,22 @@
+// Copyright (C) 2020 Joel Rosdahl and other contributors
+//
+// See doc/AUTHORS.adoc for a complete list of contributors.
+//
+// This program is free software; you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3 of the License, or (at your option)
+// any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+// more details.
+//
+// You should have received a copy of the GNU General Public License along with
+// this program; if not, write to the Free Software Foundation, Inc., 51
+// Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+#pragma once
+
+bool lockfile_acquire(const char* path, unsigned staleness_limit);
+void lockfile_release(const char* path);
index cbfe4f4791e40a8024768e17bf458236de71413d..44413fcdc30270253fa1af67cd5e552e1f6aeb07 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2009-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -25,6 +25,7 @@
 #include "Config.hpp"
 #include "File.hpp"
 #include "StdMakeUnique.hpp"
+#include "ccache.hpp"
 #include "hash.hpp"
 #include "hashutil.hpp"
 
index f74537ac07ef113a30469f121e31e394b650f085..d60903632a3d3d9d647c2f518adbbb9b6be87667 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2019 Joel Rosdahl and other contributors
+// Copyright (C) 2019-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -26,6 +26,7 @@
 #include "File.hpp"
 #include "Stat.hpp"
 #include "Util.hpp"
+#include "stats.hpp"
 
 // Result data format
 // ==================
index 8f5ee558d808bf94921f5ca980af2e94dbb5d1db..4a3da04d9c15afc2c990cc5f34aad2a368d18f2d 100644 (file)
 // Routines to handle the stats files. The stats file is stored one per cache
 // subdirectory to make this more scalable.
 
+#include "stats.hpp"
+
 #include "AtomicFile.hpp"
-#include "ccache.hpp"
 #include "cleanup.hpp"
+#include "counters.hpp"
 #include "hashutil.hpp"
+#include "lockfile.hpp"
 
 #include <cmath>
 #include <fcntl.h>
diff --git a/src/stats.hpp b/src/stats.hpp
new file mode 100644 (file)
index 0000000..385ad34
--- /dev/null
@@ -0,0 +1,76 @@
+// Copyright (C) 2020 Joel Rosdahl and other contributors
+//
+// See doc/AUTHORS.adoc for a complete list of contributors.
+//
+// This program is free software; you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3 of the License, or (at your option)
+// any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+// more details.
+//
+// You should have received a copy of the GNU General Public License along with
+// this program; if not, write to the Free Software Foundation, Inc., 51
+// Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+#pragma once
+
+#include "system.hpp"
+
+// Statistics fields in storage order.
+enum stats {
+  STATS_NONE = 0,
+  STATS_STDOUT = 1,
+  STATS_STATUS = 2,
+  STATS_ERROR = 3,
+  STATS_CACHEMISS = 4,
+  STATS_PREPROCESSOR = 5,
+  STATS_COMPILER = 6,
+  STATS_MISSING = 7,
+  STATS_CACHEHIT_CPP = 8,
+  STATS_ARGS = 9,
+  STATS_LINK = 10,
+  STATS_NUMFILES = 11,
+  STATS_TOTALSIZE = 12,
+  STATS_OBSOLETE_MAXFILES = 13,
+  STATS_OBSOLETE_MAXSIZE = 14,
+  STATS_SOURCELANG = 15,
+  STATS_BADOUTPUTFILE = 16,
+  STATS_NOINPUT = 17,
+  STATS_MULTIPLE = 18,
+  STATS_CONFTEST = 19,
+  STATS_UNSUPPORTED_OPTION = 20,
+  STATS_OUTSTDOUT = 21,
+  STATS_CACHEHIT_DIR = 22,
+  STATS_NOOUTPUT = 23,
+  STATS_EMPTYOUTPUT = 24,
+  STATS_BADEXTRAFILE = 25,
+  STATS_COMPCHECK = 26,
+  STATS_CANTUSEPCH = 27,
+  STATS_PREPROCESSING = 28,
+  STATS_NUMCLEANUPS = 29,
+  STATS_UNSUPPORTED_DIRECTIVE = 30,
+  STATS_ZEROTIMESTAMP = 31,
+  STATS_CANTUSEMODULES = 32,
+
+  STATS_END
+};
+
+void stats_update(enum stats stat);
+void stats_flush();
+unsigned stats_get_pending(enum stats stat);
+void stats_zero();
+void stats_summary();
+void stats_print();
+void stats_update_size(const char* sfile, int64_t size, int files);
+void stats_get_obsolete_limits(const char* dir,
+                               unsigned* maxfiles,
+                               uint64_t* maxsize);
+void stats_set_sizes(const char* dir, unsigned num_files, uint64_t total_size);
+void stats_add_cleanup(const char* dir, unsigned count);
+void stats_timestamp(time_t time, struct counters* counters);
+void stats_read(const char* path, struct counters* counters);
+void stats_write(const char* path, struct counters* counters);
index 4307a7e9c0da21facf3c4194fa261636a48baca2..f22cddd7548d077406c4d484ef9cafebc0f0f368 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2010-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -65,6 +65,26 @@ extern int usleep(useconds_t);
 
 extern char** environ;
 
+#ifdef __GNUC__
+#  define ATTR_FORMAT(x, y, z)                                                 \
+    __attribute__((format(ATTRIBUTE_FORMAT_PRINTF, y, z)))
+#  define ATTR_NORETURN __attribute__((noreturn))
+#else
+#  define ATTR_FORMAT(x, y, z)
+#  define ATTR_NORETURN
+#endif
+
+#define str_eq(s1, s2) (strcmp((s1), (s2)) == 0)
+#define str_startswith(s, prefix)                                              \
+  (strncmp((s), (prefix), strlen((prefix))) == 0)
+#define str_endswith(s, suffix)                                                \
+  (strlen(s) >= strlen(suffix)                                                 \
+   && str_eq((s) + strlen(s) - strlen(suffix), (suffix)))
+#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
+
+// Buffer size for I/O operations. Should be a multiple of 4 KiB.
+#define READ_BUFFER_SIZE 65536
+
 #ifndef ESTALE
 #  define ESTALE -1
 #endif
@@ -86,3 +106,19 @@ extern char** environ;
 #  define DIR_DELIM_CH '/'
 #  define PATH_DELIM ":"
 #endif
+
+// Work with silly DOS binary open.
+#ifndef O_BINARY
+#  define O_BINARY 0
+#endif
+
+#ifdef _WIN32
+char* win32argvtos(char* prefix, char** argv, int* length);
+char* win32getshell(char* path);
+int win32execute(
+  char* path, char** argv, int doreturn, int fd_stdout, int fd_stderr);
+void add_exe_ext_if_no_to_fullpath(char* full_path_win_ext,
+                                   size_t max_size,
+                                   const char* ext,
+                                   const char* path);
+#endif
index 8dee463b22b327de578176cb03bf083da9a362a7..64e1c6ab5d389aeb24b22fe688bff9bd83e6b2e1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2010-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -19,6 +19,8 @@
 #include "framework.hpp"
 
 #include "../src/Util.hpp"
+#include "../src/args.hpp"
+#include "../src/ccache.hpp"
 #include "util.hpp"
 
 #include <float.h>
index f8d3c86a57815bc882c1a232692530c6d801cedb..cc6c67087251dca76b156b98f611b4a33a44018d 100644 (file)
@@ -18,7 +18,7 @@
 
 #pragma once
 
-#include "../src/ccache.hpp"
+#include "../src/system.hpp"
 
 // ============================================================================
 
index f5b3b01dae5a58b1cbf3f8165bc16539652898ee..567b25f42e0fad52d2d3625f24c99ee5edc2f9ce 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2010-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -16,6 +16,7 @@
 // this program; if not, write to the Free Software Foundation, Inc., 51
 // Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
+#include "../src/legacy_util.hpp"
 #include "catch2_tests.hpp"
 #include "framework.hpp"
 
index 31e8126a1a472f260cc2bf1400ed316abbd613b0..5345c5047ee82b31ea86cdb8c03d235f0f3efcd5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2019 Joel Rosdahl and other contributors
+// Copyright (C) 2019-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -18,7 +18,6 @@
 
 #include "../src/Stat.hpp"
 #include "../src/Util.hpp"
-#include "../src/ccache.hpp"
 
 #include "third_party/catch.hpp"
 
index d46bfa661e61cfb9091d0f065ab52c298e1c41b0..2d441021de7292e30e0321b6b474efc86757c135 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2010-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -18,7 +18,7 @@
 
 // This file contains tests for the functions operating on struct args.
 
-#include "../src/ccache.hpp"
+#include "../src/args.hpp"
 #include "framework.hpp"
 #include "util.hpp"
 
index 9216555f7ac4d70cfc104cfb308332170ae78e99..e47b039be76dbb77b6da17e564f3fe84e192157a 100644 (file)
@@ -19,7 +19,9 @@
 // This file contains tests for the processing of compiler arguments.
 
 #include "../src/Config.hpp"
+#include "../src/args.hpp"
 #include "../src/ccache.hpp"
+#include "../src/stats.hpp"
 #include "framework.hpp"
 #include "util.hpp"
 
index 98a834ea3fc1b88f18e9b39bdbcc12ff701321f2..6a331bc9cb69e735da93e668dbc57ba478cb2997 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2010-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -18,7 +18,6 @@
 
 // This file contains tests for the compopt_* functions.
 
-#include "../src/ccache.hpp"
 #include "../src/compopt.hpp"
 #include "framework.hpp"
 
index e84168901746d45213d6c2b435106d967d32244e..a8439be84c8c64f56971b1acf3397cd2ef5c8df6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2010-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -16,7 +16,6 @@
 // this program; if not, write to the Free Software Foundation, Inc., 51
 // Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
-#include "../src/ccache.hpp"
 #include "../src/counters.hpp"
 #include "framework.hpp"
 #include "util.hpp"
index 6d8795c467aa8d263ea3a90def9d68babebdfcd5..2c402b20477c3ace48663d84a5aa66174824a302 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2010-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -18,7 +18,6 @@
 
 // This file contains tests for functions in hash.c.
 
-#include "../src/ccache.hpp"
 #include "../src/hash.hpp"
 #include "framework.hpp"
 
index 2cb6c05988278e8fee42f92e99e7626218a31050..db41f090f72c5fee893d089f19ff20aa4fc3b1af 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2010-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -18,7 +18,6 @@
 
 // This file contains tests for functions in hashutil.c.
 
-#include "../src/ccache.hpp"
 #include "../src/hashutil.hpp"
 #include "framework.hpp"
 #include "util.hpp"
index a08a65dea8db06f07aa38b9c0c37e56a59737e2c..d46117e35776762a085fd8228067e2c804fc9f67 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2010-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -18,7 +18,8 @@
 
 // This file contains tests for functions in util.c.
 
-#include "../src/ccache.hpp"
+#include "../src/execute.hpp"
+#include "../src/legacy_util.hpp"
 #include "framework.hpp"
 
 TEST_SUITE(legacy_util)
index 1f81cf7a8f7627567b9fa9f18849e6aa4285e85a..e389c954a414d9fbd9feb9a97635721ddb94298e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2010-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -19,7 +19,8 @@
 // This file contains tests for functions in lockfile.c.
 
 #include "../src/Stat.hpp"
-#include "../src/ccache.hpp"
+#include "../src/legacy_util.hpp"
+#include "../src/lockfile.hpp"
 #include "framework.hpp"
 #include "util.hpp"
 
index aa3aaa26bda1f7395c16aac857dde2b8c64b0bda..402ae1b5880605421f50db7e408c5b85fe2fed99 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2019 Joel Rosdahl and other contributors
+// Copyright (C) 2010-2020 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -18,8 +18,8 @@
 
 // This file contains tests for statistics handling.
 
-#include "../src/ccache.hpp"
 #include "../src/counters.hpp"
+#include "../src/stats.hpp"
 #include "framework.hpp"
 #include "util.hpp"