Browse Source

libandroid-glob: Fix building with unified headers

android-5
Fredrik Fornwall 7 years ago
parent
commit
b3ad7ceed6
  1. 2
      packages/libandroid-glob/build.sh
  2. 2
      packages/libandroid-glob/glob.c
  3. 4
      packages/libandroid-glob/glob.h

2
packages/libandroid-glob/build.sh

@ -1,6 +1,6 @@
TERMUX_PKG_HOMEPAGE=http://man7.org/linux/man-pages/man3/glob.3.html TERMUX_PKG_HOMEPAGE=http://man7.org/linux/man-pages/man3/glob.3.html
TERMUX_PKG_DESCRIPTION="Shared library for the glob(3) system function" TERMUX_PKG_DESCRIPTION="Shared library for the glob(3) system function"
TERMUX_PKG_VERSION=0.3 TERMUX_PKG_VERSION=0.4
TERMUX_PKG_BUILD_IN_SRC=yes TERMUX_PKG_BUILD_IN_SRC=yes
termux_step_make_install () { termux_step_make_install () {

2
packages/libandroid-glob/glob.c

@ -183,7 +183,7 @@ glob(const char *pattern, int flags, int (*errfunc)(const char *, int), glob_t *
if (flags & GLOB_LIMIT) { if (flags & GLOB_LIMIT) {
limit = pglob->gl_matchc; limit = pglob->gl_matchc;
if (limit == 0) if (limit == 0)
limit = ARG_MAX; limit = sysconf(_SC_ARG_MAX);
} else } else
limit = 0; limit = 0;
pglob->gl_flags = flags & ~GLOB_MAGCHAR; pglob->gl_flags = flags & ~GLOB_MAGCHAR;

4
packages/libandroid-glob/glob.h

@ -61,7 +61,6 @@ typedef struct {
int (*gl_stat)(const char *, struct stat *); int (*gl_stat)(const char *, struct stat *);
} glob_t; } glob_t;
#if __POSIX_VISIBLE >= 199209
/* Believed to have been introduced in 1003.2-1992 */ /* Believed to have been introduced in 1003.2-1992 */
#define GLOB_APPEND 0x0001 /* Append to output from previous call. */ #define GLOB_APPEND 0x0001 /* Append to output from previous call. */
#define GLOB_DOOFFS 0x0002 /* Use gl_offs. */ #define GLOB_DOOFFS 0x0002 /* Use gl_offs. */
@ -76,9 +75,7 @@ typedef struct {
#define GLOB_ABORTED (-2) /* Unignored error. */ #define GLOB_ABORTED (-2) /* Unignored error. */
#define GLOB_NOMATCH (-3) /* No match and GLOB_NOCHECK was not set. */ #define GLOB_NOMATCH (-3) /* No match and GLOB_NOCHECK was not set. */
#define GLOB_NOSYS (-4) /* Obsolete: source comptability only. */ #define GLOB_NOSYS (-4) /* Obsolete: source comptability only. */
#endif /* __POSIX_VISIBLE >= 199209 */
#if __BSD_VISIBLE
#define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */ #define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */
#define GLOB_BRACE 0x0080 /* Expand braces ala csh. */ #define GLOB_BRACE 0x0080 /* Expand braces ala csh. */
#define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */ #define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */
@ -90,7 +87,6 @@ typedef struct {
/* source compatibility, these are the old names */ /* source compatibility, these are the old names */
#define GLOB_MAXPATH GLOB_LIMIT #define GLOB_MAXPATH GLOB_LIMIT
#define GLOB_ABEND GLOB_ABORTED #define GLOB_ABEND GLOB_ABORTED
#endif /* __BSD_VISIBLE */
__BEGIN_DECLS __BEGIN_DECLS
int glob(const char *, int, int (*)(const char *, int), glob_t *); int glob(const char *, int, int (*)(const char *, int), glob_t *);

Loading…
Cancel
Save