Merge pull request #969 from Qartar/win64

Minor fixes/updates for Visual Studio 2015 Win64
develop
Lethosor 2016-08-10 15:15:44 -04:00 committed by GitHub
commit 6e741b1a80
5 changed files with 17 additions and 4 deletions

@ -67,7 +67,17 @@ add_definitions ( "/D_CRT_NONSTDC_NO_WARNINGS")
add_definitions( "/wd4503") add_definitions( "/wd4503")
endif() endif()
SET(DFHACK_BUILD_ARCH "32" CACHE STRING "Architecture to build ('32' or '64')") # Automatically detect architecture based on Visual Studio generator
IF(MSVC AND NOT DEFINED DFHACK_BUILD_ARCH)
IF(${CMAKE_GENERATOR} MATCHES "Win64")
SET(DFHACK_BUILD_ARCH "64")
ELSE()
SET(DFHACK_BUILD_ARCH "32")
ENDIF()
ELSE()
SET(DFHACK_BUILD_ARCH "32" CACHE STRING "Architecture to build ('32' or '64')")
ENDIF()
IF("${DFHACK_BUILD_ARCH}" STREQUAL "32") IF("${DFHACK_BUILD_ARCH}" STREQUAL "32")
SET(DFHACK_BUILD_32 1) SET(DFHACK_BUILD_32 1)
SET(DFHACK_BUILD_64 0) SET(DFHACK_BUILD_64 0)

@ -202,6 +202,9 @@ LIST(APPEND LIBPROTOBUF_FULL_SRCS ${LIBPROTOBUF_LITE_SRCS})
IF(CMAKE_COMPILER_IS_GNUCC) IF(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wno-sign-compare") SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wno-sign-compare")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result")
ELSEIF(MSVC)
# Disable warnings for integer conversion to smaller type
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267")
ENDIF() ENDIF()
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})

@ -2373,7 +2373,7 @@ static int internal_setAddress(lua_State *L)
// Print via printerr, so that it is definitely logged to stderr.log. // Print via printerr, so that it is definitely logged to stderr.log.
uintptr_t iaddr = addr - Core::getInstance().vinfo->getRebaseDelta(); uintptr_t iaddr = addr - Core::getInstance().vinfo->getRebaseDelta();
fprintf(stderr, "Setting global '%s' to %x (%x)\n", name.c_str(), addr, iaddr); fprintf(stderr, "Setting global '%s' to %p (%p)\n", name.c_str(), (void*)addr, (void*)iaddr);
fflush(stderr); fflush(stderr);
return 1; return 1;

@ -309,7 +309,7 @@ VMethodInterposeLinkBase::VMethodInterposeLinkBase(virtual_identity *host, int v
*/ */
fprintf(stderr, "Bad VMethodInterposeLinkBase arguments: %d %p (%s)\n", fprintf(stderr, "Bad VMethodInterposeLinkBase arguments: %d %p (%s)\n",
vmethod_idx, uintptr_t(interpose_method), name_str); vmethod_idx, interpose_method, name_str);
fflush(stderr); fflush(stderr);
abort(); abort();
} }

@ -1023,7 +1023,7 @@ static VALUE rb_dfmemory_set_clear(VALUE self, VALUE set)
/* call an arbitrary object virtual method */ /* call an arbitrary object virtual method */
#ifdef WIN32 #if defined(_WIN32) && !defined(_WIN64)
__declspec(naked) static int raw_vcall(void *that, void *fptr, unsigned long a0, __declspec(naked) static int raw_vcall(void *that, void *fptr, unsigned long a0,
unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5) unsigned long a1, unsigned long a2, unsigned long a3, unsigned long a4, unsigned long a5)
{ {