From: Elijah Newren Date: Sat, 03 Jun 2023 02:04:31 GMT Subject: Re: [PATCH] statinfo.h: move DTYPE defines from dir.h Message-ID: In-Reply-To: On Fri, Jun 2, 2023 at 6:56 PM Junio C Hamano 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.