summaryrefslogtreecommitdiffstats
path: root/src/util.h
Commit message (Collapse)AuthorAgeFilesLines
* util: Remove unnecessary CanonicalizePath error handlingBrad King2021-06-041-4/+2
| | | | | | | | | Since commit 86f606fe (Remove path component limit from input of CanonicalizePath in windows, 2017-08-30, v1.8.0^2~2^2), the only failure case in the `CanonicalizePath` implementation is the "empty path" error. All call sites have been updated to ensure `CanonicalizePath` is never called with an empty path. Remove error handling from the signature to simplify call sites.
* Put builder output through status interfaceColin Cross2021-02-051-0/+8
| | | | | | Send all output after manifest parsing is finished to the Status interface, so that when status frontends are added they can handle build messages.
* Comply with project formatting rules wrt 80 column linesMichael Jones2020-09-301-1/+2
|
* Remove 'using namespace std' from header files, properly namespace all std ↵Michael Jones2020-09-301-12/+11
| | | | symbols
* Win32Fatal: support a "hint" for the errorBen Boeckel2018-11-091-1/+1
| | | | | The callsite might have extra context which is helpful for interpreting the error message.
* Add NINJA_FALLTHROUGH macroStefan Becker2018-04-111-0/+14
| | | | | | | | Borrow macro implementation from OpenSSL code. Add the macro after each fallthrough switch case to indicate our intention to the compiler. This silences GCC -Wimplicit-fallthrough warnings, which is implied by GCC 7.x -Wextra.
* Fix for reviewTakuto Ikuta2017-05-091-0/+2
|
* Allow more path componentsDaniel Weber2016-08-221-2/+2
| | | | | | | - 60 instead of 30 path components - 64 instead of 32 backslashes in a path (windows only) Issue: 1161
* fix order of args to CanonicalizePathScott Graham2014-11-091-3/+3
|
* remove CanonicalizePath overloads, test for toplevel behaviourScott Graham2014-11-091-4/+0
|
* track back->forward conversions in a bitmaskScott Graham2014-11-081-0/+6
|
* More robust escaping of $in, $out pathsNicholas Hutchinson2014-01-061-0/+7
| | | | | | In summary: don’t escape if the path doesn’t contain problematic characters, otherwise: - Shell: enclose string in single quotes, escape embedded single quotes with the magic quote-backslash-quote sequence - Win32: Escape double quotes by doubling the number of consecutive backslashes that precede them (if any) and adding one more. Finally, double the number of trailing backslashes, and enclose the whole thing in double quotes.
* Don't use va_start() with reference parameters, it's undefined behavior.Nico Weber2013-05-241-1/+1
| | | | Should fix issue #584.
* Introduce a Truncate() function that works on POSIX and Windows.Nico Weber2013-04-291-0/+3
| | | | Hopefully fixes the build on Windows.
* fix compile error about noreturn on windowswang-bin2013-04-071-3/+3
|
* add noreturn attr on Fatal()Evan Martin2013-04-051-2/+8
|
* Posix symbols are not enabled by default for MSVCPeter Kümmel2013-03-141-0/+2
|
* wrap some overlong linesEvan Martin2012-12-291-1/+2
|
* Remove unused macro NINJA_UNUSED_ARG.Nico Weber2012-08-281-2/+0
|
* move Win32Fatal into utilEvan Martin2012-08-121-0/+3
|
* doc that ReadFile reads in text mode on WindowsEvan Martin2012-08-121-1/+2
|
* windows: fix size_t<->int conversions in ninja.exeEvan Martin2012-08-101-1/+1
|
* use DiskInterface to create the build directoryEvan Martin2012-08-071-4/+0
| | | | | | | | | | Fixes issue #392 (didn't handle creating nested build dirs right). Moves MakeDir out of util.h; all code should go through DiskInterface to simplify testing. Moves ownership of the DiskInterface into the client of the Builder, which also allows removing some code that reached inside the object as well as a minor leak.
* Merge branch 'factor-elide-middle' of git://github.com/polrop/ninjaEvan Martin2012-08-011-0/+4
|\ | | | | | | | | Conflicts: src/util.cc
| * Re-factor elide code and test it.Nicolas Despres2012-07-311-0/+4
| |
* | move processor-count code to util.ccEvan Martin2012-07-281-0/+4
| |
* | delete vestigal declarationsEvan Martin2012-07-281-7/+0
|/
* Merge branch 'set_terminate' of git://github.com/gmoudry/ninja into minidumpEvan Martin2012-07-271-0/+7
|\ | | | | | | | | | | | | (This likely doesn't compile, just getting all the history in place.) Conflicts: src/util.cc
| * Improve handling of fatal errors on Windows, support creation of minidumpsJiri Moudry2012-03-281-0/+7
| |
* | Merge pull request #351 from syntheticpp/rateEvan Martin2012-07-271-5/+0
|\ \ | | | | | | print edges per second
| * | print edges per secondPeter Kuemmel2012-07-151-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | prints the rate of finished edges per second to the console, for instance with NINJA_STATUS="[%s/%t %o(%c)/s] ": [132/1922 16.1(14)/s] 16.1 is the average for all processed files (here 132 since start) 14 is the average of the last n files while n is the number specifies by -j (or its default)
* | | Remove #pragma once from our header files.Thiago Farina2012-07-171-1/+0
|/ / | | | | | | | | | | https://github.com/martine/ninja/issues/358 Signed-off-by: Thiago Farina <tfarina@chromium.org>
* | Only store command hashes in the build log.Nico Weber2012-06-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | .build_log load time 350ms -> 17ms, filesize 197MB -> 1.6MB on Mac. On Windows, it's 500ms -> 20ms. Makes the build log a lot less useful for scripts, but there could be a tool for use cases that need log information. A prototype of such a tool is in https://github.com/nico/ninja/commit/1b243d311 The hash function is 64bit murmurhash2. Assuming that that different commands get the same hash only by chance, it's is very unlikely for two different commands to hash to the same value with a 64bit hash.
* | Add -l N option to limit the load average.Nicolas Despres2012-04-191-0/+4
|/ | | | | | | This is similar to GNU make -l/--load-average option. It limits the number of job started if the load average exceed the given value. It can be very useful when running ninja on a continuous integration server where we want to use parallelism as much as possible without overloading the server.
* only msvc needs these workaroundsPeter Kuemmel2012-01-221-1/+3
|
* windows: use _WIN32 define everywhereEvan Martin2012-01-221-1/+1
| | | | Rather than mixing use of WIN32 and _WIN32.
* Strip ansi escape sequences from subcommand output when not writing to a ↵Nico Weber2012-01-191-0/+3
| | | | smart terminal.
* Stop warning about chdir etc which are treated as errors on MSVC with theFrances Buontempo2012-01-161-0/+1
| | | | current settings
* split canonicalizeEvan Martin2012-01-091-0/+2
|
* allow spellcheck to be used with a vector of stringsEvan Martin2012-01-041-2/+6
|
* windows: make bootstrap.py/configure.py work with MSVCScott Graham2012-01-041-0/+2
|
* typedef long long for MSVCFrances Buontempo2012-01-031-0/+4
|
* factor out windows perror equivalentEvan Martin2011-12-201-0/+3
|
* Remove warning triggered by -Wextra on MinGW.Nicolas Despres2011-11-191-0/+2
|
* Add spelling suggestions for four cases:Nico Weber2011-11-161-0/+4
| | | | | | | | | | | 1. For targets, when invoking ninja to build a target. 2. For targets, when doing a "query" command. 3. For command names. 4. For the subcommands of the "targets" command. Also change CmdTargets() to call LookupNode() instead of GetNode() -- since the result was checked for NULL, that's probably what was intended here originally.
* move SetCloseOnExec to utilEvan Martin2011-10-311-0/+3
|
* make CanonicalizePath report an error on empty pathEvan Martin2011-10-061-1/+1
| | | | Fixes part of issue 121, but the fix exposed a further issue.
* semantic change: allow reaching into parent directories in pathsEvan Martin2011-08-241-1/+1
| | | | | | | | | | | This allows generating build files in a subdirectory of your source tree. - Change CanonicalizePath to accept this. - CanonicalizePath no longer has an error condition, so change it to a void function. I profiled the result against Chrome and it might be ~100ms slower, but that might just be Chrome's size working against me. In any case I think there are lower-hanging performance fruit elsewhere.
* remove +x bit from sourceEvan Martin2011-06-031-0/+0
|
* Tests now build on a native Windows build (tested with VS2010)Philip Craig2011-05-281-0/+4
| | | | | All tests except SubProcess pass on a native Windows build Tests continue not to build on a platform=mingw build