diff --git a/C/cdmgr.c b/C/cdmgr.c index 43d2ea05c..7feda492c 100644 --- a/C/cdmgr.c +++ b/C/cdmgr.c @@ -787,6 +787,10 @@ static void kill_children(LogUpdIndex *c, PredEntry *ap) { ncl = c->ChildIndex; /* kill children */ while (ncl) { + if (ncl->ClRefCount>0) { + c->ClRefCount--; +return; + } kill_first_log_iblock(ncl, c, ap); ncl = c->ChildIndex; } @@ -862,7 +866,7 @@ static void kill_first_log_iblock(LogUpdIndex *c, LogUpdIndex *parent, if (DBErasedIList) DBErasedIList->PrevSiblingIndex = c; DBErasedIList = c; - if (!((c->ClFlags & InUseMask) || c->ClRefCount)) { + if (!(c->ClFlags & InUseMask || c->ClRefCount)) { kill_off_lu_block(c, parent, ap); } else { if (c->ClFlags & ErasedMask) diff --git a/C/errors.c b/C/errors.c index 34b4512c2..791113072 100755 --- a/C/errors.c +++ b/C/errors.c @@ -337,7 +337,7 @@ bool Yap_PrintWarning(Term twarning) { FunctorPrintMessage, PROLOG_MODULE)); // PROCEDURE_print_message2; if (twarning) __android_log_print(ANDROID_LOG_INFO, "YAPDroid ", " warning(%s)", - Yap_TermToBuffer(twarning, Quote_illegal_f | Ignore_ops_f | Ignore_cyclics_f)); + Yap_TermToBuffer(twarning, Quote_illegal_f | Ignore_ops_f | Handle_cyclics_f)); Term cmod = (CurrentModule == PROLOG_MODULE ? TermProlog : CurrentModule); bool rc; Term ts[2], err; diff --git a/CMakeLists.txt b/CMakeLists.txt index f81f79b5e..5e30b9ef5 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -616,7 +616,6 @@ add_subDIRECTORY(utf8proc ) set(CXX_SWIG_OUTDIR ${CMAKE_BINARY_DIR}/packages/swig/android) add_subdirectory(packages/swig/android) add_definitions(-DMYDDAS=1 -DEMBEDDED_MYDDAS=1 -DMYDDAS_SQLITE3=1 -DEMBEDDED_SQLITE3=1) - link_directories(${CMAKE_SOURCE_DIR}/../sqlite-android/jni/${CMAKE_ANDROID_ARCH_ABI}) else() add_definitions(-DMYDDAS=1 -DEMBEDDED_MYDDAS=1 -DMYDDAS_SQLITE3=1 ) @@ -656,7 +655,8 @@ if (WIN32 OR ANDROID) if (ANDROID) List(APPEND YLIBS $) List(APPEND YLIBS $) - set(ANDROID_LIBRARIES sqliteX android log) + set(ANDROID_LIBRARIES ${CMAKE_SOURCE_DIR}/../sqlite-android/jni/${ANDROID_ABI}/libsqliteX.so android log) + link_directories(${CMAKE_SOURCE_DIR}/../sqlite-android/jni/${ANDROID_ABI}) endif () endif () @@ -967,6 +967,7 @@ if (WIN32) endif (WIN32) +if (NOT ANDROID) add_executable(yap-bin ${CONSOLE_SOURCES}) set_target_properties(yap-bin PROPERTIES OUTPUT_NAME yap) @@ -980,6 +981,7 @@ install(TARGETS libYap yap-bin ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) +endif() if (WITH_MPI) diff --git a/CXX/yapq.hh b/CXX/yapq.hh index d77256888..9a13b7a38 100644 --- a/CXX/yapq.hh +++ b/CXX/yapq.hh @@ -98,7 +98,7 @@ public: /// should be a callable /// goal. inline YAPQuery(const char *s) : YAPPredicate(s, goal, names, (nts = &ARG1)) { - __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "got game %d", + __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "got game %ld", LOCAL_CurSlot); openQuery(); diff --git a/console/yap.c b/console/yap.c index 3bcda15ea..a335b59b4 100755 --- a/console/yap.c +++ b/console/yap.c @@ -147,7 +147,7 @@ int main(int argc, char **argv) YAP_Reset(YAP_FULL_RESET, false); /* End preprocessor code */ - mtrace(); + //mtrace(); bool rc = exec_top_level(BootMode, &init_args); if (!rc) return 1; diff --git a/os/streams.c b/os/streams.c index 051d9d7c1..60120570a 100644 --- a/os/streams.c +++ b/os/streams.c @@ -131,7 +131,6 @@ FILE *Yap_GetOutputStream(Term t, const char *msg) { return rc; } -cmax =7; int GetFreeStreamD(void) { CACHE_REGS LOCK(GLOBAL_StreamDescLock);