Skip to content

Commit

Permalink
Define HAVE_VISIBILITY for fileinfo extension (php#14618)
Browse files Browse the repository at this point in the history
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 phpGH-5526 (-Wundef)
  • Loading branch information
petk authored Jun 21, 2024
1 parent b12ccb3 commit 6e2ad3c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ext/fileinfo/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ if test "$PHP_FILEINFO" != "no"; then
libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
])

AX_GCC_FUNC_ATTRIBUTE([visibility])

PHP_NEW_EXTENSION(fileinfo, fileinfo.c php_libmagic.c $libmagic_sources, $ext_shared,,-I@ext_srcdir@/libmagic)
PHP_ADD_BUILD_DIR($ext_builddir/libmagic)

Expand Down
8 changes: 8 additions & 0 deletions ext/fileinfo/libmagic/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@
#ifndef HAVE_STDINT_H
#define HAVE_STDINT_H 1
#endif

#ifndef HAVE_VISIBILITY
# ifdef HAVE_FUNC_ATTRIBUTE_VISIBILITY
# define HAVE_VISIBILITY 1
# else
# define HAVE_VISIBILITY 0
# endif
#endif

0 comments on commit 6e2ad3c

Please sign in to comment.