mirror of
https://github.com/corda/corda.git
synced 2025-01-04 04:04:27 +00:00
fix msvc build
This commit is contained in:
parent
a142a46d41
commit
b3978c0a0a
@ -859,7 +859,7 @@ Java_java_io_RandomAccessFile_readBytes(JNIEnv* e, jclass, jlong peer,
|
|||||||
uint8_t* dst = reinterpret_cast<uint8_t*>
|
uint8_t* dst = reinterpret_cast<uint8_t*>
|
||||||
(e->GetPrimitiveArrayCritical(buffer, 0));
|
(e->GetPrimitiveArrayCritical(buffer, 0));
|
||||||
|
|
||||||
ssize_t bytesRead = ::read(fd, dst + offset, length);
|
int64_t bytesRead = ::read(fd, dst + offset, length);
|
||||||
e->ReleasePrimitiveArrayCritical(buffer, dst, 0);
|
e->ReleasePrimitiveArrayCritical(buffer, dst, 0);
|
||||||
|
|
||||||
if(bytesRead == -1) {
|
if(bytesRead == -1) {
|
||||||
|
@ -11,6 +11,9 @@
|
|||||||
#ifndef AVIAN_UTIL_MATH_H
|
#ifndef AVIAN_UTIL_MATH_H
|
||||||
#define AVIAN_UTIL_MATH_H
|
#define AVIAN_UTIL_MATH_H
|
||||||
|
|
||||||
|
#undef max
|
||||||
|
#undef min
|
||||||
|
|
||||||
namespace avian {
|
namespace avian {
|
||||||
namespace util {
|
namespace util {
|
||||||
|
|
||||||
|
34
makefile
34
makefile
@ -873,20 +873,23 @@ endif
|
|||||||
|
|
||||||
ifdef msvc
|
ifdef msvc
|
||||||
no-error =
|
no-error =
|
||||||
|
target-format = pe
|
||||||
windows-path = $(native-path)
|
windows-path = $(native-path)
|
||||||
windows-java-home := $(shell $(windows-path) "$(JAVA_HOME)")
|
windows-java-home := $(shell $(windows-path) "$(JAVA_HOME)")
|
||||||
zlib := $(shell $(windows-path) "$(win32)/msvc")
|
zlib := $(shell $(windows-path) "$(win32)/msvc")
|
||||||
ms_cl_compiler = regular
|
ms_cl_compiler = regular
|
||||||
|
as = $(build-cc)
|
||||||
cxx = "$(msvc)/BIN/cl.exe"
|
cxx = "$(msvc)/BIN/cl.exe"
|
||||||
cc = $(cxx)
|
cc = $(cxx)
|
||||||
ld = "$(msvc)/BIN/link.exe"
|
ld = "$(msvc)/BIN/link.exe"
|
||||||
mt = "mt.exe"
|
mt = "mt.exe"
|
||||||
|
ar = "$(msvc)/BIN/lib.exe"
|
||||||
manifest-flags = -MANIFEST -MANIFESTFILE:$(@).manifest
|
manifest-flags = -MANIFEST -MANIFESTFILE:$(@).manifest
|
||||||
cflags = -nologo -DAVIAN_VERSION=\"$(version)\" -D_JNI_IMPLEMENTATION_ \
|
cflags = -nologo -DAVIAN_VERSION=\"$(version)\" -D_JNI_IMPLEMENTATION_ \
|
||||||
-DUSE_ATOMIC_OPERATIONS -DAVIAN_JAVA_HOME=\"$(javahome)\" \
|
-DUSE_ATOMIC_OPERATIONS -DAVIAN_JAVA_HOME=\"$(javahome)\" \
|
||||||
-DAVIAN_EMBED_PREFIX=\"$(embed-prefix)\" \
|
-DAVIAN_EMBED_PREFIX=\"$(embed-prefix)\" \
|
||||||
-Fd$(build)/$(name).pdb -I"$(zlib)/include" -I$(src) -I$(classpath-src) \
|
-Fd$(build)/$(name).pdb -I"$(zlib)/include" -I$(src) -I$(classpath-src) \
|
||||||
-I"$(build)" \
|
-I"$(build)" -Iinclude \
|
||||||
-I"$(windows-java-home)/include" -I"$(windows-java-home)/include/win32" \
|
-I"$(windows-java-home)/include" -I"$(windows-java-home)/include/win32" \
|
||||||
-DTARGET_BYTES_PER_WORD=$(pointer-size)
|
-DTARGET_BYTES_PER_WORD=$(pointer-size)
|
||||||
|
|
||||||
@ -899,21 +902,18 @@ ifdef msvc
|
|||||||
-DEFAULTLIB:zlib -DEFAULTLIB:user32 -MANIFEST -debug
|
-DEFAULTLIB:zlib -DEFAULTLIB:user32 -MANIFEST -debug
|
||||||
output = -Fo$(1)
|
output = -Fo$(1)
|
||||||
|
|
||||||
ifeq ($(mode),debug)
|
cflags_debug = -Od -Zi -MDd
|
||||||
cflags += -Od -Zi -MDd
|
cflags_debug_fast = -Od -Zi -DNDEBUG
|
||||||
endif
|
cflags_fast = -O2 -GL -Zi -DNDEBUG
|
||||||
ifeq ($(mode),debug-fast)
|
cflags_small = -O1s -Zi -GL -DNDEBUG
|
||||||
cflags += -Od -Zi -DNDEBUG
|
|
||||||
endif
|
|
||||||
ifeq ($(mode),fast)
|
ifeq ($(mode),fast)
|
||||||
cflags += -O2 -GL -Zi -DNDEBUG
|
|
||||||
lflags += -LTCG
|
lflags += -LTCG
|
||||||
endif
|
endif
|
||||||
ifeq ($(mode),small)
|
ifeq ($(mode),small)
|
||||||
cflags += -O1s -Zi -GL -DNDEBUG
|
|
||||||
lflags += -LTCG
|
lflags += -LTCG
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
use-lto = false
|
||||||
strip = :
|
strip = :
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -1026,19 +1026,15 @@ compiler-sources = \
|
|||||||
$(src)/codegen/registers.cpp \
|
$(src)/codegen/registers.cpp \
|
||||||
$(src)/codegen/targets.cpp
|
$(src)/codegen/targets.cpp
|
||||||
compiler-objects = $(call cpp-objects,$(compiler-sources),$(src),$(build))
|
compiler-objects = $(call cpp-objects,$(compiler-sources),$(src),$(build))
|
||||||
$(compiler-objects): $(wildcard $(src)/codegen/compiler/*.h) $(vm-depends)
|
|
||||||
|
|
||||||
x86-assembler-sources = $(wildcard $(src)/codegen/target/x86/*.cpp)
|
x86-assembler-sources = $(wildcard $(src)/codegen/target/x86/*.cpp)
|
||||||
x86-assembler-objects = $(call cpp-objects,$(x86-assembler-sources),$(src),$(build))
|
x86-assembler-objects = $(call cpp-objects,$(x86-assembler-sources),$(src),$(build))
|
||||||
$(x86-assembler-objects): $(wildcard $(src)/codegen/target/x86/*.h) $(vm-depends)
|
|
||||||
|
|
||||||
arm-assembler-sources = $(wildcard $(src)/codegen/target/arm/*.cpp)
|
arm-assembler-sources = $(wildcard $(src)/codegen/target/arm/*.cpp)
|
||||||
arm-assembler-objects = $(call cpp-objects,$(arm-assembler-sources),$(src),$(build))
|
arm-assembler-objects = $(call cpp-objects,$(arm-assembler-sources),$(src),$(build))
|
||||||
$(arm-assembler-objects): $(wildcard $(src)/codegen/target/arm/*.h) $(vm-depends)
|
|
||||||
|
|
||||||
powerpc-assembler-sources = $(wildcard $(src)/codegen/target/powerpc/*.cpp)
|
powerpc-assembler-sources = $(wildcard $(src)/codegen/target/powerpc/*.cpp)
|
||||||
powerpc-assembler-objects = $(call cpp-objects,$(powerpc-assembler-sources),$(src),$(build))
|
powerpc-assembler-objects = $(call cpp-objects,$(powerpc-assembler-sources),$(src),$(build))
|
||||||
$(powerpc-assembler-objects): $(wildcard $(src)/codegen/target/powerpc/*.h) $(vm-depends)
|
|
||||||
|
|
||||||
all-assembler-sources = \
|
all-assembler-sources = \
|
||||||
$(x86-assembler-sources) \
|
$(x86-assembler-sources) \
|
||||||
@ -1352,6 +1348,14 @@ $(test-dep): $(classpath-dep)
|
|||||||
|
|
||||||
$(test-extra-dep): $(classpath-dep)
|
$(test-extra-dep): $(classpath-dep)
|
||||||
|
|
||||||
|
$(compiler-objects): $(wildcard $(src)/codegen/compiler/*.h) $(vm-depends)
|
||||||
|
|
||||||
|
$(x86-assembler-objects): $(wildcard $(src)/codegen/target/x86/*.h) $(vm-depends)
|
||||||
|
|
||||||
|
$(arm-assembler-objects): $(wildcard $(src)/codegen/target/arm/*.h) $(vm-depends)
|
||||||
|
|
||||||
|
$(powerpc-assembler-objects): $(wildcard $(src)/codegen/target/powerpc/*.h) $(vm-depends)
|
||||||
|
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
run: build
|
run: build
|
||||||
$(library-path) $(test-executable) $(test-args)
|
$(library-path) $(test-executable) $(test-args)
|
||||||
@ -1507,7 +1511,7 @@ endef
|
|||||||
define compile-unittest-object
|
define compile-unittest-object
|
||||||
@echo "compiling $(@)"
|
@echo "compiling $(@)"
|
||||||
@mkdir -p $(dir $(@))
|
@mkdir -p $(dir $(@))
|
||||||
$(cxx) $(cflags) -c $$($(windows-path) -I$(unittest) $(<)) $(call output,$(@))
|
$(cxx) $(cflags) -c $$($(windows-path) $(<)) -I$(unittest) $(call output,$(@))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(vm-cpp-objects): $(build)/%.o: $(src)/%.cpp $(vm-depends)
|
$(vm-cpp-objects): $(build)/%.o: $(src)/%.cpp $(vm-depends)
|
||||||
@ -1814,7 +1818,7 @@ $(executable-dynamic): $(driver-dynamic-objects) $(dynamic-library)
|
|||||||
@echo "linking $(@)"
|
@echo "linking $(@)"
|
||||||
ifdef ms_cl_compiler
|
ifdef ms_cl_compiler
|
||||||
$(ld) $(lflags) -LIBPATH:$(build) -DEFAULTLIB:$(name) \
|
$(ld) $(lflags) -LIBPATH:$(build) -DEFAULTLIB:$(name) \
|
||||||
-debug -PDB:$(subst $(exe-suffix),.pdb,$(@))
|
-debug -PDB:$(subst $(exe-suffix),.pdb,$(@)) \
|
||||||
$(driver-dynamic-objects) -out:$(@) $(manifest-flags)
|
$(driver-dynamic-objects) -out:$(@) $(manifest-flags)
|
||||||
ifdef mt
|
ifdef mt
|
||||||
$(mt) -nologo -manifest $(@).manifest -outputresource:"$(@);1"
|
$(mt) -nologo -manifest $(@).manifest -outputresource:"$(@);1"
|
||||||
|
@ -16,6 +16,9 @@
|
|||||||
|
|
||||||
#include <avian/util/math.h>
|
#include <avian/util/math.h>
|
||||||
|
|
||||||
|
#undef max
|
||||||
|
#undef min
|
||||||
|
|
||||||
namespace vm {
|
namespace vm {
|
||||||
|
|
||||||
class Vector {
|
class Vector {
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
|
||||||
#include "float.h"
|
#include "float.h"
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#ifdef powerpc
|
#ifdef powerpc
|
||||||
# undef powerpc
|
# undef powerpc
|
||||||
@ -38,15 +39,6 @@
|
|||||||
// don't complain about using 'this' in member initializers:
|
// don't complain about using 'this' in member initializers:
|
||||||
# pragma warning(disable:4355)
|
# pragma warning(disable:4355)
|
||||||
|
|
||||||
typedef char int8_t;
|
|
||||||
typedef unsigned char uint8_t;
|
|
||||||
typedef short int16_t;
|
|
||||||
typedef unsigned short uint16_t;
|
|
||||||
typedef int int32_t;
|
|
||||||
typedef unsigned int uint32_t;
|
|
||||||
typedef __int64 int64_t;
|
|
||||||
typedef unsigned __int64 uint64_t;
|
|
||||||
|
|
||||||
#define strncasecmp _strnicmp
|
#define strncasecmp _strnicmp
|
||||||
|
|
||||||
#define FP_NAN 0
|
#define FP_NAN 0
|
||||||
@ -66,11 +58,6 @@ inline int fpclassify(double d) {
|
|||||||
return FP_UNDEF;
|
return FP_UNDEF;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define INT32_MIN ((int32_t) _I32_MIN)
|
|
||||||
#define INT32_MAX _I32_MAX
|
|
||||||
#define INT64_MIN ((int64_t) _I64_MIN)
|
|
||||||
#define INT64_MAX _I64_MAX
|
|
||||||
|
|
||||||
inline int signbit(double d) {
|
inline int signbit(double d) {
|
||||||
return _copysign(1.0, d) < 0;
|
return _copysign(1.0, d) < 0;
|
||||||
}
|
}
|
||||||
@ -94,19 +81,16 @@ inline int signbit(double d) {
|
|||||||
# ifdef _M_IX86
|
# ifdef _M_IX86
|
||||||
typedef int32_t intptr_t;
|
typedef int32_t intptr_t;
|
||||||
typedef uint32_t uintptr_t;
|
typedef uint32_t uintptr_t;
|
||||||
# define UINT64_C(x) x##LL
|
|
||||||
# define ARCH_x86_32
|
# define ARCH_x86_32
|
||||||
# define BYTES_PER_WORD 4
|
# define BYTES_PER_WORD 4
|
||||||
# elif defined _M_X64
|
# elif defined _M_X64
|
||||||
typedef int64_t intptr_t;
|
typedef int64_t intptr_t;
|
||||||
typedef uint64_t uintptr_t;
|
typedef uint64_t uintptr_t;
|
||||||
# define UINT64_C(x) x##L
|
|
||||||
# define ARCH_x86_64
|
# define ARCH_x86_64
|
||||||
# define BYTES_PER_WORD 8
|
# define BYTES_PER_WORD 8
|
||||||
# elif defined _M_ARM_FP
|
# elif defined _M_ARM_FP
|
||||||
typedef int32_t intptr_t;
|
typedef int32_t intptr_t;
|
||||||
typedef uint32_t uintptr_t;
|
typedef uint32_t uintptr_t;
|
||||||
# define UINT64_C(x) x##LL
|
|
||||||
# define ARCH_arm
|
# define ARCH_arm
|
||||||
# define BYTES_PER_WORD 4
|
# define BYTES_PER_WORD 4
|
||||||
# else
|
# else
|
||||||
|
@ -1329,9 +1329,6 @@ checkDaemon(Thread* t);
|
|||||||
object&
|
object&
|
||||||
root(Thread* t, Machine::Root root);
|
root(Thread* t, Machine::Root root);
|
||||||
|
|
||||||
#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
|
|
||||||
# define vmRun vmRun_
|
|
||||||
#endif
|
|
||||||
extern "C" uint64_t
|
extern "C" uint64_t
|
||||||
vmRun(uint64_t (*function)(Thread*, uintptr_t*), uintptr_t* arguments,
|
vmRun(uint64_t (*function)(Thread*, uintptr_t*), uintptr_t* arguments,
|
||||||
void* checkpoint);
|
void* checkpoint);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
const unsigned NAME(BootMask) = (~static_cast<unsigned>(0))
|
const unsigned NAME(BootMask) = (~static_cast<unsigned>(0))
|
||||||
/ NAME(BytesPerWord);
|
/ NAME(BytesPerWord);
|
||||||
|
|
||||||
const unsigned NAME(BootShift) = 32 - log(NAME(BytesPerWord));
|
const unsigned NAME(BootShift) = 32 - avian::util::log(NAME(BytesPerWord));
|
||||||
|
|
||||||
const unsigned NAME(BootFlatConstant) = 1 << NAME(BootShift);
|
const unsigned NAME(BootFlatConstant) = 1 << NAME(BootShift);
|
||||||
const unsigned NAME(BootHeapOffset) = 1 << (NAME(BootShift) + 1);
|
const unsigned NAME(BootHeapOffset) = 1 << (NAME(BootShift) + 1);
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <avian/common.h>
|
||||||
#include <avian/util/arg-parser.h>
|
#include <avian/util/arg-parser.h>
|
||||||
|
|
||||||
namespace avian {
|
namespace avian {
|
||||||
|
Loading…
Reference in New Issue
Block a user