threads / patch / 56327

patchfixup! fsmonitor-fs-listen-macos: implement FSEvent listener on MacOS

Subject: [PATCH] fixup! fsmonitor-fs-listen-macos: implement FSEvent listener on MacOS

## tl;dr

2 messages between Aug 19, 2021 and Aug 19, 2021. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Carlo Marcelo Arenas Belón· Aug 19, 2021, 18:36 UTC · lore

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(-)
Show changes to compat/fsmonitor/fsmonitor-fs-listen-macos.c +1 −1
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
Jeff Hostetler· Aug 19, 2021, 20:48 UTC · re: Carlo Marcelo Arenas Belón · lore

Re: [PATCH] fixup! fsmonitor-fs-listen-macos: implement FSEvent listener on MacOS

On 8/19/21 2:36 PM, Carlo Marcelo Arenas Belón wrote:
Show 22 quoted lines
> 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

← back to recent threads