summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cab31fa)
raw | patch | inline | side by side (parent: cab31fa)
author | Robert Schiele <rschiele@gmail.com> | |
Thu, 24 Jan 2008 18:34:46 +0000 (19:34 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 24 Jan 2008 22:01:28 +0000 (14:01 -0800) |
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>
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>
Makefile | patch | blob | history | |
git-compat-util.h | patch | blob | history |
diff --git a/Makefile b/Makefile
index 5aac0c0c876957445cd6e2e7b81a59f40965930b..c9e54b15f79d89468e160e86aeed3d5f5f3a87bb 100644 (file)
--- a/Makefile
+++ b/Makefile
#
# Define NO_MKDTEMP if you don't have mkdtemp in the C library.
#
+# Define NO_SYS_SELECT_H if you don't have sys/select.h.
+#
# Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
# Enable it on Windows. By default, symrefs are still used.
#
COMPAT_CFLAGS += -DNO_UNSETENV
COMPAT_OBJS += compat/unsetenv.o
endif
+ifdef NO_SYS_SELECT_H
+ BASIC_CFLAGS += -DNO_SYS_SELECT_H
+endif
ifdef NO_MMAP
COMPAT_CFLAGS += -DNO_MMAP
COMPAT_OBJS += compat/mmap.o
diff --git a/git-compat-util.h b/git-compat-util.h
index b6ef5442b79bc8a071597c1b0ad5508a4ed55a33..4df90cb34e61deb56ecb49797e48e67bdc98ff3b 100644 (file)
--- a/git-compat-util.h
+++ b/git-compat-util.h
#include <sys/poll.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
+#ifndef NO_SYS_SELECT_H
#include <sys/select.h>
+#endif
#include <assert.h>
#include <regex.h>
#include <netinet/in.h>