mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
Merge branch 'master' of oss.readytalk.com:/var/local/git/avian
This commit is contained in:
commit
7733433483
@ -405,14 +405,21 @@ Java_java_io_File_openDir(JNIEnv* e, jclass, jstring path)
|
||||
{
|
||||
const char* chars = e->GetStringUTFChars(path, 0);
|
||||
if (chars) {
|
||||
unsigned length = strlen(chars);
|
||||
|
||||
RUNTIME_ARRAY(char, buffer, length + 3);
|
||||
memcpy(RUNTIME_ARRAY_BODY(buffer), chars, length);
|
||||
memcpy(RUNTIME_ARRAY_BODY(buffer) + length, "\\*", 3);
|
||||
|
||||
e->ReleaseStringUTFChars(path, chars);
|
||||
|
||||
Directory* d = new (malloc(sizeof(Directory))) Directory;
|
||||
d->handle = FindFirstFile(chars, &(d->data));
|
||||
d->handle = FindFirstFile(RUNTIME_ARRAY_BODY(buffer), &(d->data));
|
||||
if (d->handle == INVALID_HANDLE_VALUE) {
|
||||
d->dispose();
|
||||
d = 0;
|
||||
}
|
||||
|
||||
e->ReleaseStringUTFChars(path, chars);
|
||||
return reinterpret_cast<jlong>(d);
|
||||
} else {
|
||||
return 0;
|
||||
|
31
makefile
31
makefile
@ -3,12 +3,12 @@ MAKEFLAGS = -s
|
||||
name = avian
|
||||
version = 0.2
|
||||
|
||||
build-arch = $(shell uname -m | sed 's/^i.86$$/i386/')
|
||||
build-arch := $(shell uname -m | sed 's/^i.86$$/i386/')
|
||||
ifeq (Power,$(filter Power,$(build-arch)))
|
||||
build-arch = powerpc
|
||||
endif
|
||||
|
||||
build-platform = \
|
||||
build-platform := \
|
||||
$(shell uname -s | tr [:upper:] [:lower:] \
|
||||
| sed 's/^mingw32.*$$/mingw32/' \
|
||||
| sed 's/^cygwin.*$$/cygwin/')
|
||||
@ -54,10 +54,10 @@ ifdef gnu
|
||||
gnu-object-dep = $(build)/gnu-object.dep
|
||||
gnu-cflags = -DBOOT_BUILTINS=\"javaio,javalang,javalangreflect,javamath,javanet,javanio,javautil\" -DAVIAN_GNU
|
||||
gnu-lflags = -lgmp
|
||||
gnu-objects = $(shell find $(build)/gnu-objects -name "*.o")
|
||||
gnu-objects := $(shell find $(build)/gnu-objects -name "*.o")
|
||||
endif
|
||||
|
||||
root = $(shell (cd .. && pwd))
|
||||
root := $(shell (cd .. && pwd))
|
||||
build = build
|
||||
native-build = $(build)/$(platform)-$(arch)$(options)
|
||||
classpath-build = $(build)/classpath
|
||||
@ -247,8 +247,8 @@ ld := $(cc)
|
||||
build-ld := $(build-cc)
|
||||
|
||||
ifdef msvc
|
||||
windows-java-home = $(shell cygpath -m "$(JAVA_HOME)")
|
||||
zlib = $(shell cygpath -m "$(root)/win32/msvc")
|
||||
windows-java-home := $(shell cygpath -m "$(JAVA_HOME)")
|
||||
zlib := $(shell cygpath -m "$(root)/win32/msvc")
|
||||
cxx = "$(msvc)/BIN/cl.exe"
|
||||
cc = $(cxx)
|
||||
ld = "$(msvc)/BIN/link.exe"
|
||||
@ -286,7 +286,7 @@ cpp-objects = $(foreach x,$(1),$(patsubst $(2)/%.cpp,$(3)/%.o,$(x)))
|
||||
asm-objects = $(foreach x,$(1),$(patsubst $(2)/%.S,$(3)/%-asm.o,$(x)))
|
||||
java-classes = $(foreach x,$(1),$(patsubst $(2)/%.java,$(3)/%.class,$(x)))
|
||||
|
||||
jni-sources = $(shell find $(classpath) -name '*.cpp')
|
||||
jni-sources := $(shell find $(classpath) -name '*.cpp')
|
||||
jni-objects = $(call cpp-objects,$(jni-sources),$(classpath),$(native-build))
|
||||
|
||||
generated-code = \
|
||||
@ -405,7 +405,7 @@ executable = $(native-build)/$(name)${exe-suffix}
|
||||
dynamic-library = $(native-build)/$(so-prefix)$(name)$(so-suffix)
|
||||
executable-dynamic = $(native-build)/$(name)-dynamic${exe-suffix}
|
||||
|
||||
classpath-sources = $(shell find $(classpath) -name '*.java')
|
||||
classpath-sources := $(shell find $(classpath) -name '*.java')
|
||||
classpath-classes = \
|
||||
$(call java-classes,$(classpath-sources),$(classpath),$(classpath-build))
|
||||
classpath-object = $(native-build)/classpath-jar.o
|
||||
@ -464,7 +464,9 @@ args = $(flags) $(input)
|
||||
build: $(static-library) $(executable) $(dynamic-library) \
|
||||
$(executable-dynamic) $(classpath-dep) $(test-dep) $(test-extra-dep)
|
||||
|
||||
$(test-classes): $(classpath-dep)
|
||||
$(test-dep): $(classpath-dep)
|
||||
|
||||
$(test-extra-dep): $(classpath-dep)
|
||||
|
||||
.PHONY: run
|
||||
run: build
|
||||
@ -676,18 +678,13 @@ else
|
||||
endif
|
||||
$(strip) $(strip-all) $(@)
|
||||
|
||||
$(bootimage-generator): make-bootimage-generator
|
||||
|
||||
make-bootimage-generator:
|
||||
(unset MAKEFLAGS && \
|
||||
make mode=$(mode) \
|
||||
$(bootimage-generator):
|
||||
$(MAKE) mode=$(mode) \
|
||||
arch=$(build-arch) \
|
||||
platform=$(bootimage-platform) \
|
||||
bootimage=$(bootimage) \
|
||||
heapdump=$(heapdump) \
|
||||
bootimage-generator= \
|
||||
build-bootimage-generator=$(bootimage-generator) \
|
||||
$(bootimage-generator))
|
||||
$(bootimage-generator)
|
||||
|
||||
$(build-bootimage-generator): \
|
||||
$(vm-objects) $(classpath-object) $(jni-objects) $(heapwalk-objects) \
|
||||
|
@ -6351,7 +6351,9 @@ class SegFaultHandler: public System::SignalHandler {
|
||||
void* oldBase = t->base;
|
||||
void* oldStack = t->stack;
|
||||
|
||||
t->ip = *ip;
|
||||
// add one to the IP since findLineNumber will subtract one
|
||||
// when we make the trace:
|
||||
t->ip = static_cast<uint8_t*>(*ip) + 1;
|
||||
t->base = *base;
|
||||
t->stack = static_cast<void**>(*stack)
|
||||
- t->arch->frameReturnAddressSize();
|
||||
|
@ -678,8 +678,13 @@ class MySystem: public System {
|
||||
virtual Status open(System::Directory** directory, const char* name) {
|
||||
Status status = 1;
|
||||
|
||||
unsigned length = strlen(name);
|
||||
RUNTIME_ARRAY(char, buffer, length + 3);
|
||||
memcpy(RUNTIME_ARRAY_BODY(buffer), name, length);
|
||||
memcpy(RUNTIME_ARRAY_BODY(buffer) + length, "\\*", 3);
|
||||
|
||||
Directory* d = new (allocate(this, sizeof(Directory))) Directory(this);
|
||||
d->handle = FindFirstFile(name, &(d->data));
|
||||
d->handle = FindFirstFile(RUNTIME_ARRAY_BODY(buffer), &(d->data));
|
||||
if (d->handle == INVALID_HANDLE_VALUE) {
|
||||
d->dispose();
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user