Skip to contentSkip to conversation

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

PATCH In review Carlo Marcelo Arenas Belón 2 participants 2 messages Aug 19, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fixup! fsmonitor-fs-listen-macos: implement FSEvent listener on MacOS

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

---
 compat/fsmonitor/fsmonitor-fs-listen-macos.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
compat/fsmonitor/fsmonitor-fs-listen-macos.c +1 -1
index 02f89de216..c55ec35b5d 100644
@@ -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.
Signature · 1 line
2.33.0.481.g26d3bed244
#1 lore raw
Quoted 17 lines · 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

---
  compat/fsmonitor/fsmonitor-fs-listen-macos.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
compat/fsmonitor/fsmonitor-fs-listen-macos.c +0 -0
index 02f89de216..c55ec35b5d 100644

compat/fsmonitor/fsmonitor-fs-listen-macos.c line 4

Quoted 5 lines
compat/fsmonitor/fsmonitor-fs-listen-macos.c +1 -1
@@ -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