aboutsummaryrefslogtreecommitdiff
path: root/build2/depdb.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-11-22 12:24:38 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-11-22 12:24:38 +0200
commit5f9dcd5364993f32e6841ffdfefce1cc87017b22 (patch)
tree82d44aefe90d98337d1b5324d55d6bcacc41416a /build2/depdb.hxx
parent04c2bf359f9065300808ff389c06aa0811e7376b (diff)
Make backwards modification time check permanent, add another experiment
Diffstat (limited to 'build2/depdb.hxx')
-rw-r--r--build2/depdb.hxx27
1 files changed, 26 insertions, 1 deletions
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 <build2/types.hxx>
#include <build2/utility.hxx>
+#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 <build2/depdb.ixx>
+
#endif // BUILD2_DEPDB_HXX