compat/fsmonitor/fsm-listen-darwin: stub in backend for Darwin

Stub in empty implementation of fsmonitor--daemon backend for Darwin (aka MacOS). Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff Hostetler committed Mar 25, 2022 at 18:02 UTC f67df2556f372f6095270bf870f32ff84def2e4b
3 files changed +33
compat/fsmonitor/fsm-listen-darwin.c new
+20
@@ -0,0 +1,20 @@
1 +#include "cache.h"
2 +#include "fsmonitor.h"
3 +#include "fsm-listen.h"
4 +
5 +int fsm_listen__ctor(struct fsmonitor_daemon_state *state)
6 +{
7 + return -1;
8 +}
9 +
10 +void fsm_listen__dtor(struct fsmonitor_daemon_state *state)
11 +{
12 +}
13 +
14 +void fsm_listen__stop_async(struct fsmonitor_daemon_state *state)
15 +{
16 +}
17 +
18 +void fsm_listen__loop(struct fsmonitor_daemon_state *state)
19 +{
20 +}
config.mak.uname
+10
@@ -157,6 +157,16 @@ ifeq ($(uname_S),Darwin)
157 MSGFMT = /usr/local/opt/gettext/bin/msgfmt
158 endif
159 endif
160 +
161 + # The builtin FSMonitor on MacOS builds upon Simple-IPC. Both require
162 + # Unix domain sockets and PThreads.
163 + ifndef NO_PTHREADS
164 + ifndef NO_UNIX_SOCKETS
165 + FSMONITOR_DAEMON_BACKEND = darwin
166 + endif
167 + endif
168 +
169 + BASIC_LDFLAGS += -framework CoreServices
170 endif
171 ifeq ($(uname_S),SunOS)
172 NEEDS_SOCKET = YesPlease
contrib/buildsystems/CMakeLists.txt
+3
@@ -289,6 +289,9 @@ if(SUPPORTS_SIMPLE_IPC)
289 if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
290 add_compile_definitions(HAVE_FSMONITOR_DAEMON_BACKEND)
291 list(APPEND compat_SOURCES compat/fsmonitor/fsm-listen-win32.c)
292 + elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
293 + add_compile_definitions(HAVE_FSMONITOR_DAEMON_BACKEND)
294 + list(APPEND compat_SOURCES compat/fsmonitor/fsm-listen-darwin.c)
295 endif()
296 endif()
297