Skip to content

Commit 6d45eb1

Browse files
Jojo-Schmitzgitster
authored andcommitted
make poll available for other platforms lacking it
move poll.[ch] out of compat/win32/ into compat/poll/ and adjust Makefile with the changed paths. Adding comments to Makefile about how/when to enable it and add logic for this Signed-off-by: Joachim Schmitz <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 83379df commit 6d45eb1

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

Makefile

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ all::
154154
#
155155
# Define NO_MMAP if you want to avoid mmap.
156156
#
157+
# Define NO_SYS_POLL_H if you don't have sys/poll.h.
158+
#
159+
# Define NO_POLL if you do not have or don't want to use poll().
160+
# This also implies NO_SYS_POLL_H.
161+
#
157162
# Define NO_PTHREADS if you do not have or do not want to use Pthreads.
158163
#
159164
# Define NO_PREAD if you have a problem with pread() system call (e.g.
@@ -603,10 +608,10 @@ LIB_H += compat/bswap.h
603608
LIB_H += compat/cygwin.h
604609
LIB_H += compat/mingw.h
605610
LIB_H += compat/obstack.h
611+
LIB_H += compat/poll/poll.h
606612
LIB_H += compat/precompose_utf8.h
607613
LIB_H += compat/terminal.h
608614
LIB_H += compat/win32/dirent.h
609-
LIB_H += compat/win32/poll.h
610615
LIB_H += compat/win32/pthread.h
611616
LIB_H += compat/win32/syslog.h
612617
LIB_H += connected.h
@@ -1224,7 +1229,7 @@ ifeq ($(uname_S),Windows)
12241229
NO_PREAD = YesPlease
12251230
NEEDS_CRYPTO_WITH_SSL = YesPlease
12261231
NO_LIBGEN_H = YesPlease
1227-
NO_SYS_POLL_H = YesPlease
1232+
NO_POLL = YesPlease
12281233
NO_SYMLINK_HEAD = YesPlease
12291234
NO_IPV6 = YesPlease
12301235
NO_UNIX_SOCKETS = YesPlease
@@ -1265,7 +1270,7 @@ ifeq ($(uname_S),Windows)
12651270
BASIC_CFLAGS = -nologo -I. -I../zlib -Icompat/vcbuild -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE
12661271
COMPAT_OBJS = compat/msvc.o compat/winansi.o \
12671272
compat/win32/pthread.o compat/win32/syslog.o \
1268-
compat/win32/poll.o compat/win32/dirent.o
1273+
compat/win32/dirent.o
12691274
COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DNOGDI -DHAVE_STRING_H -DHAVE_ALLOCA_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
12701275
BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE -NODEFAULTLIB:MSVCRT.lib
12711276
EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib
@@ -1320,7 +1325,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
13201325
NO_PREAD = YesPlease
13211326
NEEDS_CRYPTO_WITH_SSL = YesPlease
13221327
NO_LIBGEN_H = YesPlease
1323-
NO_SYS_POLL_H = YesPlease
1328+
NO_POLL = YesPlease
13241329
NO_SYMLINK_HEAD = YesPlease
13251330
NO_UNIX_SOCKETS = YesPlease
13261331
NO_SETENV = YesPlease
@@ -1355,7 +1360,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
13551360
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
13561361
COMPAT_OBJS += compat/mingw.o compat/winansi.o \
13571362
compat/win32/pthread.o compat/win32/syslog.o \
1358-
compat/win32/poll.o compat/win32/dirent.o
1363+
compat/win32/dirent.o
13591364
EXTLIBS += -lws2_32
13601365
PTHREAD_LIBS =
13611366
X = .exe
@@ -1609,6 +1614,11 @@ ifdef NO_GETTEXT
16091614
BASIC_CFLAGS += -DNO_GETTEXT
16101615
USE_GETTEXT_SCHEME ?= fallthrough
16111616
endif
1617+
ifdef NO_POLL
1618+
NO_SYS_POLL_H = YesPlease
1619+
COMPAT_CFLAGS += -DNO_POLL -Icompat/poll
1620+
COMPAT_OBJS += compat/poll/poll.o
1621+
endif
16121622
ifdef NO_STRCASESTR
16131623
COMPAT_CFLAGS += -DNO_STRCASESTR
16141624
COMPAT_OBJS += compat/strcasestr.o
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)