diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-03-12 20:06:20 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-03-12 21:01:40 -0700 |
| commit | 0ad3a110be9070b87ecd7e1c71d20a02660d8959 (patch) | |
| tree | bf0e2f92683d046f8473a65d86ad846becd913d9 /src/rt/rust_builtin.cpp | |
| parent | b60c3bfa4a95fecae2f28929f22f38865d7e5f79 (diff) | |
| download | rust-0ad3a110be9070b87ecd7e1c71d20a02660d8959.tar.gz rust-0ad3a110be9070b87ecd7e1c71d20a02660d8959.zip | |
Work around linkage bug cross-compiling from x86_64-apple-darwin to i686-apple-darwin
The correct opendir/readdir to use appear to be the 64-bit versions called opendir$INODE64, etc. but for some reason I can't get them to link properly on i686. Putting them in librustrt and making gcc figure it out works. This mystery will have to wait for another day.
Diffstat (limited to 'src/rt/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 248f851e5b9..8d83e2036b9 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -818,6 +818,33 @@ rust_dec_kernel_live_count() { task->kernel->dec_live_count(); } +#ifndef _WIN32 +#include <sys/types.h> +#include <dirent.h> + +extern "C" DIR* +rust_opendir(char *dirname) { + return opendir(dirname); +} + +extern "C" dirent* +rust_readdir(DIR *dirp) { + return readdir(dirp); +} + +#else + +extern "C" void +rust_opendir() { +} + +extern "C" void +rust_readdir() { +} + +#endif + + // // Local Variables: // mode: C++ |
