fix platform=windows and process=interpret builds

This commit is contained in:
Joel Dice 2008-12-03 08:44:07 -07:00
parent 457c3d135e
commit 93d4fbc43d
2 changed files with 69 additions and 5 deletions

View File

@ -2876,7 +2876,7 @@ class MyProcessor: public Processor {
{ {
return vm::makeMethod return vm::makeMethod
(t, vmFlags, returnCode, parameterCount, parameterFootprint, flags, (t, vmFlags, returnCode, parameterCount, parameterFootprint, flags,
offset, name, spec, class_, code, 0); offset, 0, name, spec, class_, code, 0);
} }
virtual object virtual object
@ -3056,6 +3056,32 @@ class MyProcessor: public Processor {
return 0; return 0;
} }
virtual void compileThunks(vm::Thread*, BootImage*, uint8_t*, unsigned*,
unsigned)
{
abort(s);
}
virtual void compileMethod(vm::Thread*, Zone*, uint8_t*, unsigned*, unsigned,
object*, object*, DelayedPromise**, object)
{
abort(s);
}
virtual void visitRoots(BootImage*, HeapWalker*) {
abort(s);
}
virtual unsigned* makeCallTable(vm::Thread*, BootImage*, HeapWalker*,
uint8_t*)
{
abort(s);
}
virtual void boot(vm::Thread*, BootImage* image) {
expect(s, image == 0);
}
virtual void dispose(vm::Thread* t) { virtual void dispose(vm::Thread* t) {
t->m->heap->free(t, sizeof(Thread)); t->m->heap->free(t, sizeof(Thread));
} }

View File

@ -11,6 +11,7 @@
#include "sys/stat.h" #include "sys/stat.h"
#include "windows.h" #include "windows.h"
#include "sys/timeb.h" #include "sys/timeb.h"
#include "dirent.h"
#undef max #undef max
#undef min #undef min
@ -422,6 +423,31 @@ class MySystem: public System {
HANDLE file; HANDLE file;
}; };
class Directory: public System::Directory {
public:
Directory(System* s, DIR* directory): s(s), directory(directory) { }
virtual const char* next() {
if (directory) {
dirent* e = readdir(directory);
if (e) {
return e->d_name;
}
}
return 0;
}
virtual void dispose() {
if (directory) {
closedir(directory);
}
s->free(this);
}
System* s;
DIR* directory;
};
class Library: public System::Library { class Library: public System::Library {
public: public:
Library(System* s, HMODULE handle, const char* name, bool mapName): Library(System* s, HMODULE handle, const char* name, bool mapName):
@ -630,19 +656,31 @@ class MySystem: public System {
return status; return status;
} }
virtual Status open(System::Directory** directory, const char* name) {
Status status = 1;
DIR* d = opendir(name);
if (d) {
*directory = new (allocate(this, sizeof(Directory))) Directory(this, d);
status = 0;
}
return status;
}
virtual FileType identify(const char* name) { virtual FileType identify(const char* name) {
struct _stat s; struct _stat s;
int r = _stat(name, &s); int r = _stat(name, &s);
if (r == 0) { if (r == 0) {
if (S_ISREG(s.st_mode)) { if (S_ISREG(s.st_mode)) {
return File; return TypeFile;
} else if (S_ISDIR(s.st_mode)) { } else if (S_ISDIR(s.st_mode)) {
return Directory; return TypeDirectory;
} else { } else {
return Unknown; return TypeUnknown;
} }
} else { } else {
return DoesNotExist; return TypeDoesNotExist;
} }
} }