Re: [BUG] daemon.c blows up on OSX

3 messages, 3 authors, 2016-08-11 · open the first message on its own page

Re: [BUG] daemon.c blows up on OSX

From: Junio C Hamano <hidden>
Date: 2016-08-11 20:35:54

"Terje Sten Bjerkseth" [off-list ref] writes:
quoted hunk
On 12/21/06, Linus Torvalds [off-list ref] wrote:
quoted
So it really would be a hell of a lot better to figure out _why_ strings.h
doesn't "just work" when _XOPEN_SOURCE_EXTENDED is set. Or if there are
better alternatives that work on HP-UX..

Does adding a

        #define _SVID_SOURCE 1

help? Also, we should probably make the _GNU_SOURCE and _BSD_SOURCE
defines define to 1 (which is the way they'd be if we used -D_GNU_SOURCE
on the compiler command line)

IOW, the appended ...
For Mac OS X 10.4, _XOPEN_SOURCE seems to define _POSIX_C_SOURCE which
causes the NI_MAXSERV problem in netdb.h. The appended seems to make
it work.

--
diff --git a/git-compat-util.h b/git-compat-util.h
index bc296b3..41fa7f6 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -11,8 +11,10 @@
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))

+#ifndef __APPLE_CC__
#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD
needs 600 for S_ISLNK() */
#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
+#endif
#define _GNU_SOURCE
#define _BSD_SOURCE
Thanks.  While this is in a better direction than randomly
including the headers in the source, it is still sad.

Does everybody use Apple CC on OSX?  Is the symbol defined even
with GCC?  Or Gcc fixes headers well enough and makes this a
non-issue?

Re: [BUG] daemon.c blows up on OSX

From: Andreas Ericsson <hidden>
Date: 2016-06-15 22:42:47

Junio C Hamano wrote:
Does everybody use Apple CC on OSX?  Is the symbol defined even
with GCC?  Or Gcc fixes headers well enough and makes this a
non-issue?
Just for future reference

http://predef.sourceforge.net/preos.html

holds a pretty complete list of identifying macros for more kinds of 
systems than I've had the questionable privilege of having to work with. 
I've used it pretty extensively when trying to write portable code, 
since I too have a hard time liking autoconf and friends.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Re: [BUG] daemon.c blows up on OSX

From: Terje Sten Bjerkseth <hidden>
Date: 2016-08-11 19:54:04

On 12/21/06, Junio C Hamano [off-list ref] wrote:
Thanks.  While this is in a better direction than randomly
including the headers in the source, it is still sad.

Does everybody use Apple CC on OSX?  Is the symbol defined even
with GCC?  Or Gcc fixes headers well enough and makes this a
non-issue?
I'm not sure about everybody, but at least the Apple CC *is* GCC:

~/src/git terjesb$ cc --version
i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)
Copyright (C) 2005 Free Software Foundation, Inc.

so this is probably a non-issue for default setups. (Sorry about the
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help