summaryrefslogtreecommitdiffstats
path: root/src/util.h
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2013-04-29 15:57:31 (GMT)
committerNico Weber <nicolasweber@gmx.de>2013-04-29 16:01:55 (GMT)
commitbb10325339898d2833a9f24e9e0252b2c257beb1 (patch)
tree7f78186d78e2e060a26ece346129aba9015d3515 /src/util.h
parent3699cb6aa2fb29125bf725cb50fbcc593da8a8a1 (diff)
downloadNinja-bb10325339898d2833a9f24e9e0252b2c257beb1.zip
Ninja-bb10325339898d2833a9f24e9e0252b2c257beb1.tar.gz
Ninja-bb10325339898d2833a9f24e9e0252b2c257beb1.tar.bz2
Introduce a Truncate() function that works on POSIX and Windows.
Hopefully fixes the build on Windows.
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 07381a1..9740565 100644
--- a/src/util.h
+++ b/src/util.h
@@ -76,6 +76,9 @@ double GetLoadAverage();
/// exceeds @a width.
string ElideMiddle(const string& str, size_t width);
+/// Truncates a file to the given size.
+bool Truncate(const string& path, size_t size, string* err);
+
#ifdef _MSC_VER
#define snprintf _snprintf
#define fileno _fileno