diff options
Diffstat (limited to 'meta/recipes-extended/zip/zip-3.0/0001-configure-Include-dirent.h-for-closedir-opendir-APIs.patch')
| -rw-r--r-- | meta/recipes-extended/zip/zip-3.0/0001-configure-Include-dirent.h-for-closedir-opendir-APIs.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/meta/recipes-extended/zip/zip-3.0/0001-configure-Include-dirent.h-for-closedir-opendir-APIs.patch b/meta/recipes-extended/zip/zip-3.0/0001-configure-Include-dirent.h-for-closedir-opendir-APIs.patch new file mode 100644 index 0000000000..0d3af37ded --- /dev/null +++ b/meta/recipes-extended/zip/zip-3.0/0001-configure-Include-dirent.h-for-closedir-opendir-APIs.patch | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | From 9db2f8cdbbc0dfb359d3b4e5dfe48c18652ce531 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 8 May 2024 19:02:46 -0700 | ||
| 4 | Subject: [PATCH] configure: Include dirent.h for closedir/opendir APIs | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | GCC-14 is strict about function prototypes and since the | ||
| 10 | testcase tries to compile/link opendir/closedir functions | ||
| 11 | without including signatures, it fails to build the test | ||
| 12 | due to missing signatures which come from dirent.h | ||
| 13 | |||
| 14 | Therefore include the needed system header and make it more | ||
| 15 | robust. | ||
| 16 | |||
| 17 | Fixes | ||
| 18 | a.c:2:21: error: implicit declaration of function ‘closedir’ [-Wimplicit-function-declaration] | ||
| 19 | 2 | int main() { return closedir(opendir(".")); } | ||
| 20 | | ^~~~~~~~ | ||
| 21 | a.c:2:30: error: implicit declaration of function ‘opendir’ [-Wimplicit-function-declaration] | ||
| 22 | 2 | int main() { return closedir(opendir(".")); } | ||
| 23 | | ^~~~~~~ | ||
| 24 | |||
| 25 | Upstream-Status: Inactive-Upstream | ||
| 26 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 27 | --- | ||
| 28 | unix/configure | 1 + | ||
| 29 | 1 file changed, 1 insertion(+) | ||
| 30 | |||
| 31 | diff --git a/unix/configure b/unix/configure | ||
| 32 | index f917086..1dd98c6 100644 | ||
| 33 | --- a/unix/configure | ||
| 34 | +++ b/unix/configure | ||
| 35 | @@ -591,6 +591,7 @@ $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null | ||
| 36 | |||
| 37 | echo Check for directory libraries | ||
| 38 | cat > conftest.c << _EOF_ | ||
| 39 | +#include <dirent.h> | ||
| 40 | int main() { return closedir(opendir(".")); } | ||
| 41 | _EOF_ | ||
| 42 | |||
| 43 | -- | ||
| 44 | 2.45.0 | ||
| 45 | |||
