Re: [PATCH] statinfo.h: move DTYPE defines from dir.h
- From
Elijah Newren <newren@gmail.com>
- Date
- Jun 3, 2023, 02:04 UTC
- Message-ID
- <CABPp-BHZ6a8VEuK=miMAcBG9RbUz+epuQ+d1xvwbRj_tsnYqcQ@mail.gmail.com>
- In-Reply-To
- <xmqqilc571hf.fsf@gitster.g>
On Fri, Jun 2, 2023 at 6:56 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
>
> Why does name-hash.c end up with two definitions? Aren't we
> properly guarding against multiple inclusions with
>
> #ifndef __DIR_H__
> #define __DIR_H__
> ...
> struct dir_entry {
> ...
> };
> #endif
>
> or is there something funny going on?There are two _different_ things named "struct dir_entry" in the codebase:
dir.h:struct dir_entry { dir.h- unsigned int len; dir.h- char name[FLEX_ARRAY]; /* more */ dir.h-}; -- name-hash.c:struct dir_entry { name-hash.c- struct hashmap_entry ent; name-hash.c- struct dir_entry *parent; name-hash.c- int nr; name-hash.c- unsigned int namelen; name-hash.c- char name[FLEX_ARRAY]; name-hash.c-};
So, name-hash.c cannot include anything that includes dir.h.