Skip to content

Commit f67df25

Browse files
jeffhostetlergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 62c7367 commit f67df25

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

compat/fsmonitor/fsm-listen-darwin.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,16 @@ ifeq ($(uname_S),Darwin)
157157
MSGFMT = /usr/local/opt/gettext/bin/msgfmt
158158
endif
159159
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
160170
endif
161171
ifeq ($(uname_S),SunOS)
162172
NEEDS_SOCKET = YesPlease

contrib/buildsystems/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,9 @@ if(SUPPORTS_SIMPLE_IPC)
289289
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
290290
add_compile_definitions(HAVE_FSMONITOR_DAEMON_BACKEND)
291291
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)
292295
endif()
293296
endif()
294297

0 commit comments

Comments
 (0)