Re: [PATCH v7 16/29] compat/fsmonitor/fsm-listen-darwin: add MacOS header files for FSEvent
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Mar 22, 2022, 18:19 UTC
- Message-ID
- <220322.86ils5q1um.gmgdl@evledraar.gmail.com>
- In-Reply-To
- <14b775e9d8b1a4672f8175a546eb70e2790c1b23.1647972010.git.gitgitgadget@gmail.com>
On Tue, Mar 22 2022, Jeff Hostetler via GitGitGadget wrote:
> From: Jeff Hostetler <jeffhost@microsoft.com> > > compat/fsmonitor/fsm-darwin-gcc.h | 92 ++++++++++++++++++++++++++++
It's much nicer to have this compat-for-the-compat in its own header. Thanks.
Show 14 quoted lines
> compat/fsmonitor/fsm-listen-darwin.c | 24 ++++++++ > 2 files changed, 116 insertions(+) > create mode 100644 compat/fsmonitor/fsm-darwin-gcc.h > > diff --git a/compat/fsmonitor/fsm-darwin-gcc.h b/compat/fsmonitor/fsm-darwin-gcc.h > new file mode 100644 > index 00000000000..1c75c3d48e7 > --- /dev/null > +++ 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...
Show 15 quoted lines
> [...] > +#endif /* !clang */ > +#endif /* FSM_DARWIN_GCC_H */ > diff --git a/compat/fsmonitor/fsm-listen-darwin.c b/compat/fsmonitor/fsm-listen-darwin.c > index c84e3344ab9..d2ce942cade 100644 > --- a/compat/fsmonitor/fsm-listen-darwin.c > +++ b/compat/fsmonitor/fsm-listen-darwin.c > @@ -1,3 +1,27 @@ > +#ifndef __clang__ > +#include "fsm-darwin-gcc.h" > +#else > +#include <CoreFoundation/CoreFoundation.h> > +#include <CoreServices/CoreServices.h> > + > [...]