fix MSVC build regressions

This commit is contained in:
Joel Dice 2011-01-21 16:14:21 -07:00
parent 0cc6156932
commit 220f7760b7
6 changed files with 17 additions and 8 deletions

View File

@ -37,10 +37,12 @@
# define OPEN_MASK O_BINARY
# ifdef _MSC_VER
# define S_ISREG(x) ((x) | _S_IFREG)
# define S_ISDIR(x) ((x) | _S_IFDIR)
# define S_ISREG(x) ((x) & _S_IFREG)
# define S_ISDIR(x) ((x) & _S_IFDIR)
# define S_IRUSR _S_IREAD
# define S_IWUSR _S_IWRITE
# define W_OK 2
# define R_OK 4
# else
# define OPEN _wopen
# define CREAT _wcreat

View File

@ -353,7 +353,8 @@ ifdef msvc
ld = "$(msvc)/BIN/link.exe"
mt = "mt.exe"
cflags = -nologo -DAVIAN_VERSION=\"$(version)\" -D_JNI_IMPLEMENTATION_ \
-DUSE_ATOMIC_OPERATIONS \
-DUSE_ATOMIC_OPERATIONS -DAVIAN_JAVA_HOME=\"$(javahome)\" \
-DAVIAN_EMBED_PREFIX=\"$(embed-prefix)\" \
-Fd$(build)/$(name).pdb -I"$(zlib)/include" -I$(src) -I"$(build)" \
-I"$(windows-java-home)/include" -I"$(windows-java-home)/include/win32"
shared = -dll

View File

@ -187,7 +187,7 @@ C++ portions of the VM, while the assembly code and helper tools are
built using GCC.
The MSVC build has been tested with Visual Studio Express Edition
versions 8 and 9. Other versions may also work.
versions 8, 9, and 10. Other versions may also work.
To build with MSVC, install Cygwin as described above and set the
following environment variables:

View File

@ -458,7 +458,7 @@ class JarIndex {
RUNTIME_ARRAY_BODY(n)[length] = '/';
RUNTIME_ARRAY_BODY(n)[length + 1] = 0;
node = findNode(n);
node = findNode(RUNTIME_ARRAY_BODY(n));
if (node) {
return System::TypeDirectory;
} else {

View File

@ -62,7 +62,13 @@ extern "C" void __cxa_pure_virtual(void) { abort(); }
// we link against a System implmentation, which requires this at link
// time, but it should not be used at runtime:
extern "C" uint64_t
vmNativeCall(void*, void*, unsigned, unsigned) { abort(); }
vmNativeCall(void*, void*, unsigned, unsigned)
{
abort();
// abort is not declared __declspec(noreturn) on MSVC, so we have to
// pretend it might return to make the compiler happy:
return 0;
}
#endif // BOOT_LIBRARY

View File

@ -206,12 +206,12 @@ resolveNativeMethod(Thread* t, object method, const char* prefix,
object
resolveNativeMethod(Thread* t, object method)
{
void* p = ::resolveNativeMethod(t, method, "Avian_", 6, 3);
void* p = resolveNativeMethod(t, method, "Avian_", 6, 3);
if (p) {
return makeNative(t, p, true);
}
p = ::resolveNativeMethod(t, method, "Java_", 5, -1);
p = resolveNativeMethod(t, method, "Java_", 5, -1);
if (p) {
return makeNative(t, p, false);
}