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.
This commit is contained in:
Brian Anderson
2013-03-12 20:06:20 -07:00
parent b60c3bfa4a
commit 0ad3a110be
4 changed files with 48 additions and 37 deletions

View File

@@ -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++