Re: [PATCH v7 16/29] compat/fsmonitor/fsm-listen-darwin: add MacOS header files for FSEvent

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

 





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 <jeffhost@xxxxxxxxxxxxx>
[...]
+++ 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



[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