From 5f9dcd5364993f32e6841ffdfefce1cc87017b22 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 22 Nov 2018 12:24:38 +0200 Subject: Make backwards modification time check permanent, add another experiment --- build2/depdb.hxx | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'build2/depdb.hxx') diff --git a/build2/depdb.hxx b/build2/depdb.hxx index ffb3b89..7319461 100644 --- a/build2/depdb.hxx +++ b/build2/depdb.hxx @@ -11,6 +11,8 @@ #include #include +#define BUILD2_MTIME_CHECK + namespace build2 { // Auxiliary dependency database (those .d files). Uses io_error and @@ -90,9 +92,23 @@ namespace build2 // may be left in the old/currupt state. Note that in the read mode this // function will "chop off" lines that haven't been read. // - timestamp + // Make sure to call verify() after updating the target for modification + // times sanity check after. + // + void close (); + // Perform target/db modification times sanity check. + // + void + verify (const path_type& target, timestamp end = timestamp_unknown); + + static void + verify (timestamp start, + const path_type& db, + const path_type& target, + timestamp end); + // Read the next line. If the result is not NULL, then it is a pointer to // the next line in the database (which you are free to move from). If you // then call write(), this line will be overwritten. @@ -213,7 +229,16 @@ namespace build2 std::fstream fs_; std::fstream::pos_type pos_; // Start of the last returned line. string line_; // Current line. + +#ifdef BUILD2_MTIME_CHECK + timestamp start_; +#ifdef _WIN32 + timestamp wtime_; +#endif +#endif }; } +#include + #endif // BUILD2_DEPDB_HXX -- cgit v1.1