build2/build2-0.16.0-glibc-2.38-2.patch

39 lines
1.2 KiB
Diff
Raw Normal View History

From 604eb708883a1f90b58e7d6292331d999db873a7 Mon Sep 17 00:00:00 2001
From: Boris Kolpackov <boris@codesynthesis.com>
Date: Thu, 24 Aug 2023 11:39:41 +0200
Subject: [PATCH] Include <features.h> for __GLIBC*__ (GH issue #324)
---
libpkg-config/libpkg-config/config.h.in | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/libpkg-config/libpkg-config/config.h.in b/libpkg-config/libpkg-config/config.h.in
index bc0cf79..7e02e75 100644
--- a/libpkg-config/libpkg-config/config.h.in
+++ b/libpkg-config/libpkg-config/config.h.in
@@ -4,6 +4,10 @@
#ifndef LIBPKG_CONFIG_CONFIG_H
#define LIBPKG_CONFIG_CONFIG_H
+#if defined(__linux__)
+# include <features.h> /* __GLIBC__, __GLIBC_MINOR__ */
+#endif
+
/*
* strndup() is not present on Windows while strl*() are only present on
* *BSD and MacOS.
@@ -13,9 +17,10 @@
# define HAVE_STRNDUP 1
#endif
-// GNU libc added strlcpy() and strlcat() in version 2.38 (in anticipation
-// of their addition to POSIX).
-//
+/*
+ * GNU libc added strlcpy() and strlcat() in version 2.38 (in anticipation
+ * of their addition to POSIX).
+ */
#if defined(__FreeBSD__) || \
defined(__OpenBSD__) || \
defined(__NetBSD__) || \