win64 fixes

This commit is contained in:
vscosta 2017-02-22 00:56:20 -08:00
parent 272ddc0228
commit 6ec69aa3c8
4 changed files with 29 additions and 24 deletions

View File

@ -936,7 +936,7 @@ static unsigned char *concat(int n, void *sv[] USES_REGS) {
buf0 = buf;
for (i = 0; i < n; i++) {
#if _WIN32 || defined(__ANDROID__)
strcpy(buf, sv[lvl]);
strcpy(buf, sv[i]);
buf = (char *)buf + strlen(buf);
#else
buf = stpcpy(buf, sv[i]);

View File

@ -495,16 +495,21 @@ bool YAPEngine::mgoal(Term t, Term tmod)
bool result;
sigjmp_buf q_env;
if (IsApplTerm(t))
{
ts = RepAppl(t) + 1;
if (arity) {
if (IsApplTerm(t))
{
ts = RepAppl(t) + 1;
}
else
{
ts = RepPair(t);
}
for (arity_t i = 0; i < arity; i++)
XREGS[i + 1] = ts[i];
} else if ( IsAtomTerm(t)) {
ts = nullptr;
}
else
{
ts = RepPair(t);
}
for (arity_t i = 0; i < arity; i++)
XREGS[i + 1] = ts[i];
q.CurSlot = Yap_StartSlots();
q.p = P;
q.cp = CP;
@ -729,7 +734,7 @@ bool YAPQuery::next()
{
q_open = false;
Yap_PopTermFromDB(LOCAL_ActiveError->errorTerm);
bzero(LOCAL_ActiveError, sizeof(*LOCAL_ActiveError));
memset(LOCAL_ActiveError, 0, sizeof(*LOCAL_ActiveError));
YAP_LeaveGoal(false, &q_h);
Yap_CloseHandles(q_handles);
q_open = false;

View File

@ -37,11 +37,10 @@ get_filename_component ( ABS_PYTHON_INCLUDE_PATH ${_ABS_PYTHON_INCLUDE_PATH} ABS
OUTPUT_VARIABLE _ABS_PYTHON_SYSLIB_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE )
set( _ABS_PYTHON_SYSLIB_PATH
${_ABS_PYTHON_SYSLIB_PATH}/../${CMAKE_SHARED_LIBRARY_PREFIX}python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}m${CMAKE_SHARED_LIBRARY_SUFFIX} )
message("${_ABS_PYTHON_SYSLIB_PATH}")
get_filename_component ( ABS_PYTHON_SYSLIB_PATH ${_ABS_PYTHON_SYSLIB_PATH} ABSOLUTE )
find_library(ABS_PYTHON_SYSLIB_PATH
NAMES python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}m
PATHS _ABS_PYTHON_SYSLIB_PATH
)
set ( PYTHON_LIBRARY
${ABS_PYTHON_SYSLIB_PATH}
@ -51,23 +50,24 @@ get_filename_component ( ABS_PYTHON_INCLUDE_PATH ${_ABS_PYTHON_INCLUDE_PATH} ABS
${PYTHON_LIBRARY}
CACHE "FILEPATH" "Python Library (Deprecated)"
)
if ( (EXISTS PYTHON_LIBRARY) AND ( EXISTS ${PYTHON_INCLUDE_DIR}) )
set ( PYTHONLIBS_FOUND ON)
else()
find_package(PythonLibs)
if ( (EXISTS ${PYTHON_LIBRARY}) AND ( EXISTS ${PYTHON_INCLUDE_DIR}) )
set ( PYTHONLIBS_FOUND ON )
# else()
#find_package(PythonLibs)
endif()
macro_log_feature (PYTHONLIBS_FOUND "Python"
"Use Python System"
"http://www.python.org" FALSE)
"http://www.python.org" FALSE )
include_directories( BEFORE ${PYTHON_INCLUDE_DIR} )
LIST( APPEND
CMAKE_REQUIRED_INCLUDES ${PYTHON_INCLUDE_DIR} ${CMAKE_REQUIRED_INCLUDES} )
CMAKE_REQUIRED_INCLUDES ${PYTHON_INCLUDE_DIR} ${CMAKE_REQUIRED_INCLUDES})
check_include_file(Python.h HAVE_PYTHON_H)
endif(WITH_PYTHON)
endif(WITH_PYTHON)

View File

@ -15,7 +15,7 @@ set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
add_library (YAPPython SHARED ${PYTHON_SOURCES})
target_link_libraries(YAPPython libYap ${PYTHON_LIBRARIES}
target_link_libraries(YAPPython libYap ${PYTHON_LIBRARY}
${WINDLLS}
${GMP_LIBRARIES})