1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-25 08:12:17 +00:00

build: replace glob() check and assume it's always in POSIX

POSIX requires glob(), so no need to check for it. Together with the
fact that we can emulate glob() on Windows, glob() is always available.
This commit is contained in:
wm4 2017-06-27 12:37:47 +02:00
parent 0b77f6fd22
commit 70a70b9da3
5 changed files with 5 additions and 11 deletions

View File

@ -115,7 +115,6 @@ static mf_t *open_mf_pattern(void *talloc_ctx, struct mp_log *log, char *filenam
char *fname = talloc_size(mf, strlen(filename) + 32);
#if HAVE_GLOB || HAVE_GLOB_WIN32_REPLACEMENT
if (!strchr(filename, '%')) {
strcpy(fname, filename);
if (!strchr(filename, '*'))
@ -138,7 +137,6 @@ static mf_t *open_mf_pattern(void *talloc_ctx, struct mp_log *log, char *filenam
globfree(&gg);
goto exit_mf;
}
#endif
mp_info(log, "search expr: %s\n", filename);

View File

@ -103,7 +103,7 @@ static bool split_opt(struct parse_state *p)
return false;
}
#if defined(__MINGW32__) && (HAVE_GLOB || HAVE_GLOB_WIN32_REPLACEMENT)
#ifdef __MINGW32__
static void process_non_option(struct playlist *files, const char *arg)
{
glob_t gg;

View File

@ -28,7 +28,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#if HAVE_GLOB
#if HAVE_POSIX
#include <glob.h>
#endif

View File

@ -208,13 +208,9 @@ iconv support use --disable-iconv.",
'func': check_true,
'deps_any': ['posix-spawn', 'mingw'],
}, {
'name': 'glob',
'desc': 'glob()',
'func': check_statement('glob.h', 'glob("filename", 0, 0, 0)')
}, {
'name': 'glob-win32-replacement',
'name': 'glob-win32',
'desc': 'glob() win32 replacement',
'deps_neg': [ 'glob' ],
'deps_neg': [ 'posix' ],
'deps_any': [ 'os-win32', 'os-cygwin' ],
'func': check_true
}, {

View File

@ -432,7 +432,7 @@ def build(ctx):
( "osdep/path-unix.c"),
( "osdep/path-win.c", "os-win32" ),
( "osdep/path-win.c", "os-cygwin" ),
( "osdep/glob-win.c", "glob-win32-replacement" ),
( "osdep/glob-win.c", "glob-win32" ),
( "osdep/w32_keyboard.c", "os-win32" ),
( "osdep/w32_keyboard.c", "os-cygwin" ),
( "osdep/windows_utils.c", "win32" ),