Skip to content

Commit

Permalink
rt: glob, globfree dummy function for android
Browse files Browse the repository at this point in the history
  • Loading branch information
yichoi committed May 4, 2013
1 parent c3ab74b commit 7ac6571
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/rt/rust_android_dummy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef __ANDROID__

#include "rust_android_dummy.h"
#include <math.h>
#include <errno.h>

#ifdef __ANDROID__

int backtrace(void **array, int size) { return 0; }

char **backtrace_symbols(void *const *array, int size) { return 0; }
Expand Down Expand Up @@ -59,7 +59,18 @@ extern "C" void srand()
extern "C" void atof()
{
}

extern "C" void tgammaf()
{
}

extern "C" int glob(const char *pattern, int flags, int (*errfunc) (const char *epath, int eerrno), glob_t *pglob)
{
return 0;
}

extern "C" void globfree(glob_t *pglob)
{
}

#endif
23 changes: 23 additions & 0 deletions src/rt/rust_android_dummy.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,28 @@ char **backtrace_symbols (void *__const *__array, int __size);

void backtrace_symbols_fd (void *__const *__array, int __size, int __fd);

#include <sys/types.h>

struct stat;
typedef struct {
size_t gl_pathc; /* Count of total paths so far. */
size_t gl_matchc; /* Count of paths matching pattern. */
size_t gl_offs; /* Reserved at beginning of gl_pathv. */
int gl_flags; /* Copy of flags parameter to glob. */
char **gl_pathv; /* List of paths matching pattern. */
/* Copy of errfunc parameter to glob. */
int (*gl_errfunc)(const char *, int);

/*
* Alternate filesystem access methods for glob; replacement
* versions of closedir(3), readdir(3), opendir(3), stat(2)
* and lstat(2).
*/
void (*gl_closedir)(void *);
struct dirent *(*gl_readdir)(void *);
void *(*gl_opendir)(const char *);
int (*gl_lstat)(const char *, struct stat *);
} glob_t;

#endif

4 comments on commit 7ac6571

@bors
Copy link
Contributor

@bors bors commented on 7ac6571 May 4, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 7ac6571 May 4, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging yichoi/rust/glob-dummy-pull = 7ac6571 into auto

@bors
Copy link
Contributor

@bors bors commented on 7ac6571 May 4, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yichoi/rust/glob-dummy-pull = 7ac6571 merged ok, testing candidate = d816101b

@bors
Copy link
Contributor

@bors bors commented on 7ac6571 May 5, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.