@matheusbsbs / matheus-bagliano / commits / 2600973f2c
Fork 0

pre-POSIX.1-2001 systems do not have <sys/select.h>

POSIX.1-2001 has declaration of select(2) in <sys/select.h>, but in the previous version of SUS, it was declared in <sys/time.h> (which is already included in git-compat-util.h). This introduces NO_SYS_SELECT_H macro in the Makefile to be set on older systems, to skip inclusion of <sys/select.h> that does not exist on them. We could check _POSIX_VERSION with 200112L and do this automatically, but earlier it was reported that the approach does not work well on some vintage of HP-UX. Other systems may get _POSIX_VERSION itself wrong. At least for now, this manual configuration is safer. Signed-off-by: Robert Schiele <rschiele@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Robert Schiele committed Jan 24, 2008 at 19:34 UTC 2600973f2c565792b71e3aed62c40efb09e08c6e
2 files changed +7
Makefile
+5
@@ -42,6 +42,8 @@ all::
42 #
43 # Define NO_MKDTEMP if you don't have mkdtemp in the C library.
44 #
45 +# Define NO_SYS_SELECT_H if you don't have sys/select.h.
46 +#
47 # Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
48 # Enable it on Windows. By default, symrefs are still used.
49 #
@@ -635,6 +637,9 @@ ifdef NO_UNSETENV
637 COMPAT_CFLAGS += -DNO_UNSETENV
638 COMPAT_OBJS += compat/unsetenv.o
639 endif
640 +ifdef NO_SYS_SELECT_H
641 + BASIC_CFLAGS += -DNO_SYS_SELECT_H
642 +endif
643 ifdef NO_MMAP
644 COMPAT_CFLAGS += -DNO_MMAP
645 COMPAT_OBJS += compat/mmap.o
git-compat-util.h
+2
@@ -68,7 +68,9 @@
68 #include <sys/poll.h>
69 #include <sys/socket.h>
70 #include <sys/ioctl.h>
71 +#ifndef NO_SYS_SELECT_H
72 #include <sys/select.h>
73 +#endif
74 #include <assert.h>
75 #include <regex.h>
76 #include <netinet/in.h>