include path on windows
Danny Smith
dansmister@gmail.com
Wed May 21 06:57:00 GMT 2008
On Tue, May 20, 2008 at 11:19 PM, Nathan Sidwell
<nathan@codesourcery.com> wrote:
> This patch fixes include path checking on non-inode file systems. The
> current behaviour is to presume all -I include paths are unique on such
> systems. We therefore fail to spot users trying to reorder the system
> include paths. However, we can do better than that by case-insensitive
> string compare. That won't catch all duplicates, but does improve the
> situation.
>
Hello
This improves the change to c-incpath.c for Windows hosts by using
lrealpath to generate a name for the DIRS_EQ comparison. Also, rather
than using OS name defines to identify the crippled hosts, we use the
HOST_LACKS_INODE_NUMBERS macro.
The patch adds a new field in struct cpp_dir to store the canonical name
generated by lrealpath. This new field is necessary because for some
usages (eg, assembler output, PCH files) the user-provided (relative)
path name may be more useful. Currently, the only usage of the canonical
name is in the DIRS_EQ comprison.
If this is too invasive, then I can work up an alternative (but more
expensive for non-POSIX host) patch that allows the DIRS_EQ macro to be
overriden by xm-host.h file code,
Danny
Tested on i686-pc-mingw32
libcpp/ChangeLog
* include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
gcc/ChangeLog
* c-incpath.c: Use HOST_LACKS_INODE_NUMBERS conditional
rather than OS names to choose INO_T_EQ definition.
(DIRS_EQ) [!INO_T_EQ]: Don't worry about case in comparison.
(add_path) [INO_T_EQ]: Use lrealpath to fill canonical_name field.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inc_realpath.diff
Type: text/x-diff
Size: 1807 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080521/0a1316d4/attachment.bin>
More information about the Gcc-patches
mailing list