Check for sys/mount.h and sys/vfs.h headers and include them conditionally

This commit is contained in:
Gleb Popov 2021-02-24 19:02:47 +03:00 committed by Wim Taymans
parent c5e42aa9db
commit dbc9a520ef
4 changed files with 20 additions and 1 deletions

View file

@ -257,6 +257,9 @@
/* Define to 1 if you have the <string.h> header file. */
#mesondefine HAVE_STRING_H
/* Define to 1 if you have the <sys/mount.h> header file. */
#mesondefine HAVE_SYS_MOUNT_H
/* Define to 1 if you have the <sys/param.h> header file. */
#mesondefine HAVE_SYS_PARAM_H
@ -284,6 +287,9 @@
/* Define to 1 if you have the <sys/utsname.h> header file. */
#mesondefine HAVE_SYS_UTSNAME_H
/* Define to 1 if you have the <sys/vfs.h> header file. */
#mesondefine HAVE_SYS_VFS_H
/* Define to 1 if you have the <sys/wait.h> header file. */
#mesondefine HAVE_SYS_WAIT_H

View file

@ -214,6 +214,7 @@ check_headers = [['dlfcn.h','HAVE_DLFCN_H'],
['stdio_ext.h', 'HAVE_STDIO_EXT_H'],
['strings.h', 'HAVE_STRINGS_H'],
['string.h', 'HAVE_STRING_H'],
['sys/mount.h', 'HAVE_SYS_MOUNT_H'],
['sys/param.h', 'HAVE_SYS_PARAM_H'],
['sys/poll.h', 'HAVE_SYS_POLL_H'],
['sys/prctl.h', 'HAVE_SYS_PRCTL_H'],
@ -223,6 +224,7 @@ check_headers = [['dlfcn.h','HAVE_DLFCN_H'],
['sys/time.h', 'HAVE_SYS_TIME_H'],
['sys/types.h', 'HAVE_SYS_TYPES_H'],
['sys/utsname.h', 'HAVE_SYS_UTSNAME_H'],
['sys/vfs.h', 'HAVE_SYS_VFS_H'],
['sys/wait.h', 'HAVE_SYS_WAIT_H'],
['pwd.h', 'HAVE_PWD_H'],
['ucontext.h', 'HAVE_UCONTEXT_H'],

View file

@ -27,12 +27,18 @@
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/vfs.h>
#include <fcntl.h>
#include <unistd.h>
#include "config.h"
#if HAVE_SYS_VFS_H
#include <sys/vfs.h>
#endif
#if HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
#include <spa/utils/result.h>
#include <spa/utils/json.h>

View file

@ -41,7 +41,12 @@
#include <sys/time.h>
#include <arpa/inet.h>
#include <fcntl.h>
#if HAVE_SYS_VFS_H
#include <sys/vfs.h>
#endif
#if HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
#if HAVE_PWD_H
#include <pwd.h>
#endif