mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
configure: check if eaccess() is available
To fix the build error on Android:
src/ucm/parser.c:2521:7: error: implicit declaration of function 'eaccess' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
if (eaccess(filename, R_OK))
^
src/ucm/parser.c:2521:7: note: did you mean 'access'?
Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
01960fa856
commit
76d1aa0cd7
3 changed files with 9 additions and 0 deletions
|
|
@ -50,6 +50,7 @@ AC_HEADER_TIME
|
||||||
dnl Checks for library functions.
|
dnl Checks for library functions.
|
||||||
AC_PROG_GCC_TRADITIONAL
|
AC_PROG_GCC_TRADITIONAL
|
||||||
AC_CHECK_FUNCS([uselocale])
|
AC_CHECK_FUNCS([uselocale])
|
||||||
|
AC_CHECK_FUNCS([eaccess])
|
||||||
|
|
||||||
SAVE_LIBRARY_VERSION
|
SAVE_LIBRARY_VERSION
|
||||||
AC_SUBST(LIBTOOL_VERSION_INFO)
|
AC_SUBST(LIBTOOL_VERSION_INFO)
|
||||||
|
|
|
||||||
|
|
@ -2518,7 +2518,11 @@ int uc_mgr_scan_master_configs(const char **_list[])
|
||||||
|
|
||||||
snprintf(fn, sizeof(fn), "%s.conf", d_name);
|
snprintf(fn, sizeof(fn), "%s.conf", d_name);
|
||||||
ucm_filename(filename, sizeof(filename), 2, d_name, fn);
|
ucm_filename(filename, sizeof(filename), 2, d_name, fn);
|
||||||
|
#ifdef HAVE_EACCESS
|
||||||
if (eaccess(filename, R_OK))
|
if (eaccess(filename, R_OK))
|
||||||
|
#else
|
||||||
|
if (access(filename, R_OK))
|
||||||
|
#endif
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
err = uc_mgr_config_load(2, filename, &cfg);
|
err = uc_mgr_config_load(2, filename, &cfg);
|
||||||
|
|
|
||||||
|
|
@ -305,7 +305,11 @@ static int if_eval_path(snd_use_case_mgr_t *uc_mgr, snd_config_t *eval)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_EACCESS
|
||||||
if (eaccess(path, amode))
|
if (eaccess(path, amode))
|
||||||
|
#else
|
||||||
|
if (access(path, amode))
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue