From: Jeff Hostetler Date: Wed, 23 Mar 2022 14:32:18 GMT Subject: Re: [PATCH v7 16/29] compat/fsmonitor/fsm-listen-darwin: add MacOS header files for FSEvent Message-ID: In-Reply-To: <220322.86ils5q1um.gmgdl@evledraar.gmail.com> On 3/22/22 2:19 PM, Ævar Arnfjörð Bjarmason wrote: > > On Tue, Mar 22 2022, Jeff Hostetler via GitGitGadget wrote: > >> From: Jeff Hostetler [...] >> +++ b/compat/fsmonitor/fsm-darwin-gcc.h >> @@ -0,0 +1,92 @@ >> +#ifndef FSM_DARWIN_GCC_H >> +#define FSM_DARWIN_GCC_H >> + >> +#ifndef __clang__ > > This was surprising, until I remembered that clang tries really hard to > pretend to be other compilers. I wonder if we should steal the macro > check from compat/compiler.h into something more generic & use it here, > probably best as a follow-up... > >> [...] yeah, V5 had this as an ifdef __GNUC__, I changed it in V6 because we were always using the hack local declarations rather than the official header files in clang builds. (Technically, it doesn't really matter, since the net result is the same, but it felt cleaner (er, less mysterious).) As for extracting a better macro from compat/compiler.h for more general use, maybe, but that's not something I want to think about right now. Doing a quick "git grep __GNUC__" turns up a lot of dark magic. There are only a couple of references to __clang__, so it might be that a good comment somewhere (say in compat/compiler.h) would be sufficient. Jeff