summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/zip/zip-3.0/0001-configure-Include-dirent.h-for-closedir-opendir-APIs.patch
blob: 0d3af37ded24817eec1b852d4c0b2a192ca59f93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 9db2f8cdbbc0dfb359d3b4e5dfe48c18652ce531 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 8 May 2024 19:02:46 -0700
Subject: [PATCH] configure: Include dirent.h for closedir/opendir APIs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

GCC-14 is strict about function prototypes and since the
testcase tries to compile/link opendir/closedir functions
without including signatures, it fails to build the test
due to missing signatures which come from dirent.h

Therefore include the needed system header and make it more
robust.

Fixes
a.c:2:21: error: implicit declaration of function ‘closedir’ [-Wimplicit-function-declaration]
    2 | int main() { return closedir(opendir(".")); }
      |                     ^~~~~~~~
a.c:2:30: error: implicit declaration of function ‘opendir’ [-Wimplicit-function-declaration]
    2 | int main() { return closedir(opendir(".")); }
      |                              ^~~~~~~

Upstream-Status: Inactive-Upstream
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 unix/configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/unix/configure b/unix/configure
index f917086..1dd98c6 100644
--- a/unix/configure
+++ b/unix/configure
@@ -591,6 +591,7 @@ $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
 
 echo Check for directory libraries
 cat > conftest.c << _EOF_
+#include <dirent.h>
 int main() { return closedir(opendir(".")); }
 _EOF_
 
-- 
2.45.0