Skip to content

Commit 6e2ad3c

Browse files
authored
Define HAVE_VISIBILITY for fileinfo extension (#14618)
The libmagic library also uses the HAVE_VISIBILITY macro that should be defined to 1 if visibility is supported or 0 if not. Follow-up of GH-5526 (-Wundef)
1 parent b12ccb3 commit 6e2ad3c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

ext/fileinfo/config.m4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ if test "$PHP_FILEINFO" != "no"; then
2121
libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
2222
])
2323

24+
AX_GCC_FUNC_ATTRIBUTE([visibility])
25+
2426
PHP_NEW_EXTENSION(fileinfo, fileinfo.c php_libmagic.c $libmagic_sources, $ext_shared,,-I@ext_srcdir@/libmagic)
2527
PHP_ADD_BUILD_DIR($ext_builddir/libmagic)
2628

ext/fileinfo/libmagic/config.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,11 @@
88
#ifndef HAVE_STDINT_H
99
#define HAVE_STDINT_H 1
1010
#endif
11+
12+
#ifndef HAVE_VISIBILITY
13+
# ifdef HAVE_FUNC_ATTRIBUTE_VISIBILITY
14+
# define HAVE_VISIBILITY 1
15+
# else
16+
# define HAVE_VISIBILITY 0
17+
# endif
18+
#endif

0 commit comments

Comments
 (0)