This commit is contained in:
Vítor Santos Costa 2019-03-11 19:05:39 +00:00
parent facf7ae8cd
commit 4d2b18908d
2 changed files with 10 additions and 5 deletions

View File

@ -1461,7 +1461,7 @@ static int not_was_reconsulted(PredEntry *p, Term t, int mode) {
// p->src.OwnerFile = Yap_ConsultingFile(PASS_REGS1); // p->src.OwnerFile = Yap_ConsultingFile(PASS_REGS1);
} }
LOCAL_LastAssertedPred = p; LOCAL_LastAssertedPred = p;
return TRUE; /* careful */ ret>urn TRUE; /* careful */
} }
static yamop *addcl_permission_error(const char *file, const char *function, 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); PELOCK(20, p);
/* we are redefining a prolog module predicate */ /* we are redefining a prolog module predicate */
if (Yap_constPred(p)) { if (Yap_constPred(p)) {
addcl_permission_error(__FILE__, __FUNCTION__, __LINE__, p, addcl_permission_error(__FILE__, __FUNCTION__, __LINE__, tf,
FALSE); FALSE);
UNLOCKPE(30, p); UNLOCKPE(30, p);
return false; return false;
@ -2185,7 +2185,7 @@ static Int p_purge_clauses(USES_REGS1) { /* '$purge_clauses'(+Func) */
PELOCK(21, pred); PELOCK(21, pred);
if (pred->PredFlags & StandardPredFlag) { if (pred->PredFlags & StandardPredFlag) {
UNLOCKPE(33, pred); 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); return (FALSE);
} }
purge_clauses(pred); purge_clauses(pred);
@ -4102,7 +4102,7 @@ static Int
| TabledPredFlag | TabledPredFlag
#endif /* TABLING */ #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"); "dbload_get_space/4");
return FALSE; return FALSE;
} }

View File

@ -384,6 +384,10 @@ if (GMP_INCLUDE_DIRS)
# READLINE_readline_LIBRARY, where to find the READLINE library. # READLINE_readline_LIBRARY, where to find the READLINE library.
# READLINE_ncurses_LIBRARY, where to find the ncurses library [might not be defined] # READLINE_ncurses_LIBRARY, where to find the ncurses library [might not be defined]
if (ANDROID)
option (WITH_READLINE "use Readline" OFF)
else()
include(FindReadline) include(FindReadline)
option (WITH_READLINE "use Readline" ON) option (WITH_READLINE "use Readline" ON)
@ -392,13 +396,14 @@ if (GMP_INCLUDE_DIRS)
# #
# ADD_SUBDIRECTORY(console/terminal) # ADD_SUBDIRECTORY(console/terminal)
if (READLINE_FOUND) if (READLINE_FOUND AND READLINE_INCLUDE_DIR)
List(APPEND YAP_SYSTEM_OPTIONS readline) List(APPEND YAP_SYSTEM_OPTIONS readline)
# required for configure # required for configure
include_directories( ${READLINE_INCLUDE_DIR} include_directories( ${READLINE_INCLUDE_DIR}
${READLINE_INCLUDE_DIR}/readline ${READLINE_INCLUDE_DIR}/readline
) )
endif () endif ()
endif()
include_directories( include_directories(
${CMAKE_SOURCE_DIR}/H ${CMAKE_SOURCE_DIR}/H