mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2024-12-23 17:33:50 +03:00
tests: Add fallback for glob()
Fix build on platforms without glob().
This commit is contained in:
parent
567f612d29
commit
2abb903344
30
runtest.c
30
runtest.c
@ -209,9 +209,35 @@ static void globfree(glob_t *pglob) {
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
#elif HAVE_DECL_GLOB
|
||||
|
||||
#include <glob.h>
|
||||
#endif
|
||||
|
||||
#else /* _WIN32, HAVE_DECL_GLOB */
|
||||
|
||||
#define GLOB_DOOFFS 0
|
||||
|
||||
typedef struct {
|
||||
size_t gl_pathc; /* Count of paths matched so far */
|
||||
char **gl_pathv; /* List of matched pathnames. */
|
||||
size_t gl_offs; /* Slots to reserve in 'gl_pathv'. */
|
||||
} glob_t;
|
||||
|
||||
static int
|
||||
glob(const char *pattern ATTRIBUTE_UNUSED, int flags ATTRIBUTE_UNUSED,
|
||||
int errfunc(const char *epath, int eerrno) ATTRIBUTE_UNUSED,
|
||||
glob_t *pglob) {
|
||||
pglob->gl_pathc = 0;
|
||||
pglob->gl_pathv = NULL;
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
static void
|
||||
globfree(glob_t *pglob ATTRIBUTE_UNUSED) {
|
||||
}
|
||||
|
||||
#endif /* _WIN32, HAVE_DECL_GLOB */
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
|
@ -145,9 +145,35 @@ static void globfree(glob_t *pglob) {
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
#elif HAVE_DECL_GLOB
|
||||
|
||||
#include <glob.h>
|
||||
#endif
|
||||
|
||||
#else /* _WIN32, HAVE_DECL_GLOB */
|
||||
|
||||
#define GLOB_DOOFFS 0
|
||||
|
||||
typedef struct {
|
||||
size_t gl_pathc; /* Count of paths matched so far */
|
||||
char **gl_pathv; /* List of matched pathnames. */
|
||||
size_t gl_offs; /* Slots to reserve in 'gl_pathv'. */
|
||||
} glob_t;
|
||||
|
||||
static int
|
||||
glob(const char *pattern ATTRIBUTE_UNUSED, int flags ATTRIBUTE_UNUSED,
|
||||
int errfunc(const char *epath, int eerrno) ATTRIBUTE_UNUSED,
|
||||
glob_t *pglob) {
|
||||
pglob->gl_pathc = 0;
|
||||
pglob->gl_pathv = NULL;
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
static void
|
||||
globfree(glob_t *pglob ATTRIBUTE_UNUSED) {
|
||||
}
|
||||
|
||||
#endif /* _WIN32, HAVE_DECL_GLOB */
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
|
Loading…
Reference in New Issue
Block a user