Subject: Re: 24.3: conflicting types for `rpl_readlink' on powerpc-apple-darwin

From: Paul Eggert <[email-masked]>
Date: Mon, 24 Feb 2014 10:42:58 -0800

Thanks, can you please try the attached patch for Emacs 24.3?

--- emacs-24.3/lib/unistd.in.h	2012-11-02 00:00:03.000000000 -0700
+++ emacs-24.3-darwin/lib/unistd.in.h	2014-02-24 10:42:15.703125069 -0800
@@ -37,9 +37,23 @@
 /* Normal invocation.  */
 #elif !defined _@GUARD_PREFIX@_UNISTD_H
 
+#ifdef _GL_INCLUDING_UNISTD_H
+/* Special invocation convention:
+   - On Mac OS X 10.3.9 we have a sequence of nested includes
+     <unistd.h> -> <signal.h> -> <pthread.h> -> <unistd.h>
+     In this situation, the functions are not yet declared, therefore we cannot
+     provide the C++ aliases.  */
+
+#@INCLUDE_NEXT@ @NEXT_UNISTD_H@
+
+#else
+/* Normal invocation convention.  */
+
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_UNISTD_H@
+# define _GL_INCLUDING_UNISTD_H
 # @INCLUDE_NEXT@ @NEXT_UNISTD_H@
+# undef _GL_INCLUDING_UNISTD_H
 #endif
 
 /* Get all possible declarations of gethostname().  */
@@ -1532,4 +1546,5 @@ _GL_CXXALIASWARN (write);

 #endif /* _@GUARD_PREFIX@_UNISTD_H */
+#endif /* _GL_INCLUDING_UNISTD_H */
 #endif /* _@GUARD_PREFIX@_UNISTD_H */