Re: [PATCH] statinfo.h: move DTYPE defines from dir.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 2, 2023 at 6:56 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
>
> 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.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux