All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fixup! fsmonitor-fs-listen-macos: implement FSEvent listener on MacOS
@ 2021-08-19 18:36 Carlo Marcelo Arenas Belón
  2021-08-19 20:48 ` Jeff Hostetler
  0 siblings, 1 reply; 2+ messages in thread
From: Carlo Marcelo Arenas Belón @ 2021-08-19 18:36 UTC (permalink / raw)
  To: git; +Cc: jeffhost, Carlo Marcelo Arenas Belón

clang defines __GNUC__ for compatibility with gcc (indeed it misrepresents
itself as gcc 4.2.1), so instead use the __clang__ specific macro to
distinguish between them.

tested with Apple clang 12.0.5, clang 14 and gcc 11.2.0

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
 compat/fsmonitor/fsmonitor-fs-listen-macos.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compat/fsmonitor/fsmonitor-fs-listen-macos.c b/compat/fsmonitor/fsmonitor-fs-listen-macos.c
index 02f89de216..c55ec35b5d 100644
--- a/compat/fsmonitor/fsmonitor-fs-listen-macos.c
+++ b/compat/fsmonitor/fsmonitor-fs-listen-macos.c
@@ -1,4 +1,4 @@
-#if defined(__GNUC__)
+#ifndef __clang__
 /*
  * It is possible to #include CoreFoundation/CoreFoundation.h when compiling
  * with clang, but not with GCC as of time of writing.
-- 
2.33.0.481.g26d3bed244


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fixup! fsmonitor-fs-listen-macos: implement FSEvent listener on MacOS
  2021-08-19 18:36 [PATCH] fixup! fsmonitor-fs-listen-macos: implement FSEvent listener on MacOS Carlo Marcelo Arenas Belón
@ 2021-08-19 20:48 ` Jeff Hostetler
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Hostetler @ 2021-08-19 20:48 UTC (permalink / raw)
  To: Carlo Marcelo Arenas Belón, git; +Cc: jeffhost



On 8/19/21 2:36 PM, Carlo Marcelo Arenas Belón wrote:
> clang defines __GNUC__ for compatibility with gcc (indeed it misrepresents
> itself as gcc 4.2.1), so instead use the __clang__ specific macro to
> distinguish between them.
> 
> tested with Apple clang 12.0.5, clang 14 and gcc 11.2.0
> 
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
>   compat/fsmonitor/fsmonitor-fs-listen-macos.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/compat/fsmonitor/fsmonitor-fs-listen-macos.c b/compat/fsmonitor/fsmonitor-fs-listen-macos.c
> index 02f89de216..c55ec35b5d 100644
> --- a/compat/fsmonitor/fsmonitor-fs-listen-macos.c
> +++ b/compat/fsmonitor/fsmonitor-fs-listen-macos.c
> @@ -1,4 +1,4 @@
> -#if defined(__GNUC__)
> +#ifndef __clang__
>   /*
>    * It is possible to #include CoreFoundation/CoreFoundation.h when compiling
>    * with clang, but not with GCC as of time of writing.
> 

thanks!
Jeff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-19 20:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19 18:36 [PATCH] fixup! fsmonitor-fs-listen-macos: implement FSEvent listener on MacOS Carlo Marcelo Arenas Belón
2021-08-19 20:48 ` Jeff Hostetler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.