Previously, GlobMatchesPath would always use FNM_PATHNAME, which does
not let '*' match path separators.
Loosen this so GlobMatchesPath can be used to match "any path name
ending with 'xyz'" using "*xyz".
This is a change in behavior for POSIX systems, but it seems like the
Windows GlobMatchesPath always worked like this (being based on
PathMatchSpec), so it creates a unified behavior across platforms.
In file included from F:/Projects/include-what-you-use/iwyu_string_util.h:21:0,
from F:/Projects/include-what-you-use/iwyu_path_util.h:18,
from F:/Projects/include-what-you-use/iwyu_path_util.cc:10:
F:/Projects/include-what-you-use/port.h:68:0: warning: "NOMINMAX" redefined
#define NOMINMAX // Prevent Windows headers from redefining min/max.
In file included from F:/git-sdk-64/mingw64/include/c++/7.3.0/x86_64-w64-mingw32/bits/c++config.h:533:0,
from F:/git-sdk-64/mingw64/include/c++/7.3.0/string:38,
from F:/Projects/include-what-you-use/iwyu_path_util.h:15,
from F:/Projects/include-what-you-use/iwyu_path_util.cc:10:
F:/git-sdk-64/mingw64/include/c++/7.3.0/x86_64-w64-mingw32/bits/os_defines.h:45:0: note: this is the location of the previous definition
#define NOMINMAX 1
Clang r273599 switched the UNICODE define on by default, which makes the
entire Windows API default to its wide-char functions.
At first glance, we won't be handling Unicode paths anyway, so use
PathMatchSpecA explicitly.
NULL/0 -> nullptr
C standard library include -> C++ counterparts
Occasional use of auto
Explicit strcmp return value check
Remove unused usings
Closing comments for anonymous namespaces
- Remove DEVTOOLS_MAINTENANCE_ from header guards, that was a
now-unnecessary Googleism
- Fix header guard to match filename in all production code
- Fix header guard to match path in all tests
- No longer necessary to define _POSIX_ for MSVC builds
- Remove some cruft from port.h
- Remove unused direct.h/unistd.h includes
- Clean up includes in iwyu_path_util.h
- No functionality change intended
- Tested on Win32/MSVC + Linux/GCC
- iwyu.gcc.imp is no longer added automatically if no mapping file is specified
- Instead, the defaults are hard-coded in iwyu_include_picker.cc
- Fix some 80-column overruns
in IWYU. Now we no longer #define a standard macro in IWYU's
header.
R=csilvers
DELTA=12 (4 added, 3 deleted, 5 changed)
Revision created by MOE tool push_codebase.
MOE_MIGRATION=2002
struct, and an unused var in non-debug mode.
R=wan
DELTA=3 (0 added, 0 deleted, 3 changed)
Revision created by MOE tool push_codebase.
MOE_MIGRATION=1977
Also makes it port.h's responsibility to export fnmatch
(before, it was the responsibility of either port.h or
iwyu_include_picker.cc, depending on the platform).
R=dsturtevant,csilvers
DELTA=152 (45 added, 4 deleted, 103 changed)
Revision created by MOE tool push_codebase.
MOE_MIGRATION=1852
test some main()-invariant logic while I'm at it.
DELTA=19 (16 added, 0 deleted, 3 changed)
Revision created by MOE tool push_codebase.
MOE_MIGRATION=1409
thought I was saying the location is where the . (or ->) is,
which is what I want, but clang doesn't actually expose that.
So I have go through some hoops to try to figure it out.
We were actually seeing a problem with this when running:
blaze build --host_cpu=k8 --compile_only -k --crosstool_top=//third_party/llvm/crosstool --plugin=//devtools/maintenance/include_what_you_use:run_iwyu //gws/plugins/local/src:enhanced_listing_ad
It has 'msg_->MSG_foo' in it, where MSG_foo is a macro. We
were attributing this use to the file defining MSG_foo, rather
than to us. With this change, we properly attribute it to us.
R=dsturtevant
DELTA=150 (125 added, 6 deleted, 19 changed)
Revision created by MOE tool push_codebase.
MOE_MIGRATION=1347