+2015-05-27 Pádraig Brady <P@draigBrady.com>
+
+ string: fix build failure on BSD/OSX with FORTIFY_SOURCE
+ This avoids a conflict with "FORTIFY_SOURCE" variants
+ of the string functions when they're replaced on NetBSD-6.0.1
+ and Darwin-14.3.0 at least.
+ * lib/string.in.h: Avoid including our "lib/string.h" while
+ including the system <string.h>.
+
2015-05-26 Eric Blake <eblake@redhat.com>
stdio: limit __gnu_printf__ witness to gcc 4.4+
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
-#ifndef _@GUARD_PREFIX@_STRING_H
-
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@
+#if defined _GL_ALREADY_INCLUDING_STRING_H
+/* Special invocation convention:
+ - On OS X/NetBSD we have a sequence of nested includes
+ <string.h> -> <strings.h> -> "string.h"
+ In this situation system _chk variants due to -D_FORTIFY_SOURCE
+ might be used after any replacements defined here. */
+
+#@INCLUDE_NEXT@ @NEXT_STRING_H@
+
+#else
+/* Normal invocation convention. */
+
+#ifndef _@GUARD_PREFIX@_STRING_H
+
+#define _GL_ALREADY_INCLUDING_STRING_H
+
/* The include_next requires a split double-inclusion guard. */
#@INCLUDE_NEXT@ @NEXT_STRING_H@
+#undef _GL_ALREADY_INCLUDING_STRING_H
+
#ifndef _@GUARD_PREFIX@_STRING_H
#define _@GUARD_PREFIX@_STRING_H
#endif /* _@GUARD_PREFIX@_STRING_H */
#endif /* _@GUARD_PREFIX@_STRING_H */
+#endif