* [PATCH] HP-UX traditionally has no sys/select.h
@ 2008-01-24 17:53 Robert Schiele
2008-01-24 18:03 ` Johannes Schindelin
2008-01-24 19:11 ` Junio C Hamano
0 siblings, 2 replies; 5+ messages in thread
From: Robert Schiele @ 2008-01-24 17:53 UTC (permalink / raw)
To: git; +Cc: gitster
The select stuff is already in sys/time.h on traditional HP-UX
systems thus we should not include sys/select.h there because older
releases don't have it.
---
git-compat-util.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index b6ef544..77de915 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -68,7 +68,9 @@
#include <sys/poll.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
+#ifndef __hpux
#include <sys/select.h>
+#endif
#include <assert.h>
#include <regex.h>
#include <netinet/in.h>
--
1.5.2.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] HP-UX traditionally has no sys/select.h
2008-01-24 17:53 [PATCH] HP-UX traditionally has no sys/select.h Robert Schiele
@ 2008-01-24 18:03 ` Johannes Schindelin
2008-01-24 18:36 ` Robert Schiele
2008-01-24 19:11 ` Junio C Hamano
1 sibling, 1 reply; 5+ messages in thread
From: Johannes Schindelin @ 2008-01-24 18:03 UTC (permalink / raw)
To: Robert Schiele; +Cc: git, gitster
Hi,
On Thu, 24 Jan 2008, Robert Schiele wrote:
> The select stuff is already in sys/time.h on traditional HP-UX
> systems thus we should not include sys/select.h there because older
> releases don't have it.
Thank you for your patch.
> diff --git a/git-compat-util.h b/git-compat-util.h
> index b6ef544..77de915 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -68,7 +68,9 @@
> #include <sys/poll.h>
> #include <sys/socket.h>
> #include <sys/ioctl.h>
> +#ifndef __hpux
> #include <sys/select.h>
> +#endif
> #include <assert.h>
> #include <regex.h>
> #include <netinet/in.h>
We try to avoid using constructs like this. Rather, we have a section in
the Makefile which sets things like NO_IPV6=YesPlease,
OLD_ICONV=UnfortunatelyYes, etc.
Later in the Makefile, dependent on this Makefile variable, symbols
are defined. In the source code, we check for these symbols.
It is not only a matter of being able to reuse the same symbol for another
platform/setup, it is also a nice way of documentation.
In your case, I suggest NO_SYS_SELECT_H=UnfortunatelyYes.
Thanks,
Dscho
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] HP-UX traditionally has no sys/select.h
2008-01-24 18:03 ` Johannes Schindelin
@ 2008-01-24 18:36 ` Robert Schiele
0 siblings, 0 replies; 5+ messages in thread
From: Robert Schiele @ 2008-01-24 18:36 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, gitster
[-- Attachment #1: Type: text/plain, Size: 822 bytes --]
On Thu, Jan 24, 2008 at 06:03:14PM +0000, Johannes Schindelin wrote:
> We try to avoid using constructs like this. Rather, we have a section in
> the Makefile which sets things like NO_IPV6=YesPlease,
> OLD_ICONV=UnfortunatelyYes, etc.
>
> Later in the Makefile, dependent on this Makefile variable, symbols
> are defined. In the source code, we check for these symbols.
>
> It is not only a matter of being able to reuse the same symbol for another
> platform/setup, it is also a nice way of documentation.
>
> In your case, I suggest NO_SYS_SELECT_H=UnfortunatelyYes.
Ok, implemented it that way now and also made HP-UX support in Makefile in a
separate patch.
Robert
--
Robert Schiele
Dipl.-Wirtsch.informatiker mailto:rschiele@gmail.com
"Quidquid latine dictum sit, altum sonatur."
[-- Attachment #2: Type: application/pgp-signature, Size: 194 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] HP-UX traditionally has no sys/select.h
2008-01-24 17:53 [PATCH] HP-UX traditionally has no sys/select.h Robert Schiele
2008-01-24 18:03 ` Johannes Schindelin
@ 2008-01-24 19:11 ` Junio C Hamano
2008-01-24 19:39 ` Robert Schiele
1 sibling, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2008-01-24 19:11 UTC (permalink / raw)
To: Robert Schiele; +Cc: git, gitster
Robert Schiele <rschiele@gmail.com> writes:
> The select stuff is already in sys/time.h on traditional HP-UX
> systems thus we should not include sys/select.h there because older
> releases don't have it.
> ---
> git-compat-util.h | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/git-compat-util.h b/git-compat-util.h
> index b6ef544..77de915 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -68,7 +68,9 @@
> #include <sys/poll.h>
> #include <sys/socket.h>
> #include <sys/ioctl.h>
> +#ifndef __hpux
> #include <sys/select.h>
> +#endif
> #include <assert.h>
> #include <regex.h>
> #include <netinet/in.h>
> --
> 1.5.2.4
We had a thread on this issue mid December.
Does this help?
>From 72a41cae180ad57c6f2daa0af9b96e284386dc1b Mon Sep 17 00:00:00 2001
From: Junio C Hamano <gitster@pobox.com>
Date: Tue, 18 Dec 2007 01:52:07 -0800
Subject: [PATCH] Do not include <sys/select.h> on pre- POSIX.1-2001 systems
For previous version of SUS, select(2) would have been declared in
<sys/time.h>, which is already included. POSIX.1-2001 moved the
declaration to <sys/select.h>, so check _POSIX_VERSION with 200112L
and skip inclusion of <sys/select.h> if it is not the case.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
git-compat-util.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index b6ef544..fb3b969 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -68,7 +68,9 @@
#include <sys/poll.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
+#if _POSIX_VERSION >= 200112L
#include <sys/select.h>
+#endif
#include <assert.h>
#include <regex.h>
#include <netinet/in.h>
--
1.5.4.rc4.23.gcab31
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-01-24 19:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-24 17:53 [PATCH] HP-UX traditionally has no sys/select.h Robert Schiele
2008-01-24 18:03 ` Johannes Schindelin
2008-01-24 18:36 ` Robert Schiele
2008-01-24 19:11 ` Junio C Hamano
2008-01-24 19:39 ` Robert Schiele
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).