From 4d2b18908deebe89ea9689aa5ae4ae5d545b4496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Mon, 11 Mar 2019 19:05:39 +0000 Subject: [PATCH] fixes --- C/cdmgr.c | 8 ++++---- CMakeLists.txt | 7 ++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/C/cdmgr.c b/C/cdmgr.c index d7cefa454..3d578ddb4 100644 --- a/C/cdmgr.c +++ b/C/cdmgr.c @@ -1461,7 +1461,7 @@ static int not_was_reconsulted(PredEntry *p, Term t, int mode) { // p->src.OwnerFile = Yap_ConsultingFile(PASS_REGS1); } LOCAL_LastAssertedPred = p; - return TRUE; /* careful */ + ret>urn TRUE; /* careful */ } static yamop *addcl_permission_error(const char *file, const char *function, @@ -1748,7 +1748,7 @@ bool Yap_addclause(Term t, yamop *cp, Term tmode, Term mod, Term *t4ref) PELOCK(20, p); /* we are redefining a prolog module predicate */ if (Yap_constPred(p)) { - addcl_permission_error(__FILE__, __FUNCTION__, __LINE__, p, + addcl_permission_error(__FILE__, __FUNCTION__, __LINE__, tf, FALSE); UNLOCKPE(30, p); return false; @@ -2185,7 +2185,7 @@ static Int p_purge_clauses(USES_REGS1) { /* '$purge_clauses'(+Func) */ PELOCK(21, pred); if (pred->PredFlags & StandardPredFlag) { UNLOCKPE(33, pred); - Yap_Error(PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE, Yap_PredicateIndicator(CurrentModule, pred), "assert/1"); + Yap_Error(PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE, Yap_PredicateIndicator(CurrentModule, t), "assert/1"); return (FALSE); } purge_clauses(pred); @@ -4102,7 +4102,7 @@ static Int | TabledPredFlag #endif /* TABLING */ )) { - Yap_Error(PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE, Yap_PredicateIndicator(CurrentModule, ap), + Yap_Error(PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE, Yap_PredicateIndicator(CurrentModule, t), "dbload_get_space/4"); return FALSE; } diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b6e814d6..d96b4c0d0 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -384,6 +384,10 @@ if (GMP_INCLUDE_DIRS) # READLINE_readline_LIBRARY, where to find the READLINE library. # READLINE_ncurses_LIBRARY, where to find the ncurses library [might not be defined] +if (ANDROID) + option (WITH_READLINE "use Readline" OFF) + else() + include(FindReadline) option (WITH_READLINE "use Readline" ON) @@ -392,13 +396,14 @@ if (GMP_INCLUDE_DIRS) # # ADD_SUBDIRECTORY(console/terminal) - if (READLINE_FOUND) + if (READLINE_FOUND AND READLINE_INCLUDE_DIR) List(APPEND YAP_SYSTEM_OPTIONS readline) # required for configure include_directories( ${READLINE_INCLUDE_DIR} ${READLINE_INCLUDE_DIR}/readline ) endif () +endif() include_directories( ${CMAKE_SOURCE_DIR}/H