vlc | branch: master | Dennis Hamester <[email protected]> | Wed Mar 22 09:58:59 2017 +0100| [3e2accc82dfcc69fdf485e4472a8f8bd7e2160ac] | committer: Jean-Baptiste Kempf
compat: Add pathconf dummy replacement for nacl Signed-off-by: Jean-Baptiste Kempf <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3e2accc82dfcc69fdf485e4472a8f8bd7e2160ac --- compat/pathconf.c | 40 ++++++++++++++++++++++++++++++++++++++++ configure.ac | 2 +- include/vlc_fixups.h | 4 ++++ 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/compat/pathconf.c b/compat/pathconf.c new file mode 100644 index 0000000..34f990a --- /dev/null +++ b/compat/pathconf.c @@ -0,0 +1,40 @@ +/***************************************************************************** + * pathconf.c: POSIX pathconf() replacement + ***************************************************************************** + * Copyright (C) 2017 VLC authors and VideoLAN + * + * Authors: Dennis Hamester <[email protected]> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + *****************************************************************************/ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <vlc_common.h> + +#ifdef __native_client__ +long pathconf (const char *path, int name) +{ + VLC_UNUSED(path); + VLC_UNUSED(name); + return -1; +} +#elif defined(_WIN32) +/* Windows does not have pathconf, but that is OK */ +#else +# error pathconf not implemented on your platform! +#endif diff --git a/configure.ac b/configure.ac index 693eaf2..203a2bf 100644 --- a/configure.ac +++ b/configure.ac @@ -596,7 +596,7 @@ need_libc=false dnl Check for usual libc functions AC_CHECK_FUNCS([daemon fcntl flock fstatvfs fork getenv getpwuid_r isatty lstat memalign mkostemp mmap open_memstream openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime tdestroy uselocale]) -AC_REPLACE_FUNCS([atof atoll dirfd fdopendir ffsll flockfile fsync getdelim getpid lldiv memrchr nrand48 poll posix_memalign recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tfind timegm timespec_get strverscmp]) +AC_REPLACE_FUNCS([atof atoll dirfd fdopendir ffsll flockfile fsync getdelim getpid lldiv memrchr nrand48 poll posix_memalign recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tfind timegm timespec_get strverscmp pathconf]) AC_REPLACE_FUNCS([gettimeofday]) AC_CHECK_FUNC(fdatasync,, [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.]) diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h index 23bf2ec..c49b435 100644 --- a/include/vlc_fixups.h +++ b/include/vlc_fixups.h @@ -259,6 +259,10 @@ pid_t getpid (void) VLC_NOTHROW; int fsync (int fd); #endif +#ifndef HAVE_PATHCONF +long pathconf (const char *path, int name); +#endif + /* dirent.h */ #ifndef HAVE_DIRFD int (dirfd) (DIR *); _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
