# HG changeset patch # User Paul Eggert # Date 1393355787 28800 # Node ID 86af85d364e1e22a1cfbb90fa8b852844e7b3de7 # Parent 0dd22c534074c91932abe30a6519ff91bb0da20c unistd: port readlink to Mac OS X 10.3.9 * lib/unistd.in.h (_GL_INCLUDING_UNISTD_H): New macro, to work around self-include problem in Mac OS X 10.3.9 when combined with readlink module. Problem reported by Klaus Zietler in . diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2014-02-25 Paul Eggert + + unistd: port readlink to Mac OS X 10.3.9 + * lib/unistd.in.h (_GL_INCLUDING_UNISTD_H): New macro, to work + around self-include problem in Mac OS X 10.3.9 when combined with + readlink module. Problem reported by Klaus Zietler in + . + 2014-02-23 Paul Eggert diffseq: remove TOO_EXPENSIVE heuristic diff --git a/lib/unistd.in.h b/lib/unistd.in.h --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -21,9 +21,23 @@ #endif @PRAGMA_COLUMNS@ +#ifdef _GL_INCLUDING_UNISTD_H +/* Special invocation convention: + - On Mac OS X 10.3.9 we have a sequence of nested includes + -> -> -> + 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(). */ @@ -1539,4 +1553,5 @@ _GL_INLINE_HEADER_END #endif /* _@GUARD_PREFIX@_UNISTD_H */ +#endif /* _GL_INCLUDING_UNISTD_H */ #endif /* _@GUARD_PREFIX@_UNISTD_H */