From 3d6c0e7933ae3aee2c8771822d59d206d01454aa Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sat, 14 Feb 2015 17:13:42 +0000 Subject: [PATCH] avoid undefined predicates --- OPTYap/opt.preds.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/OPTYap/opt.preds.c b/OPTYap/opt.preds.c index 9ea4df8f7..9fc6e820d 100644 --- a/OPTYap/opt.preds.c +++ b/OPTYap/opt.preds.c @@ -51,10 +51,10 @@ static Int p_show_statistics_tabling( USES_REGS1 ); static Int p_show_statistics_global_trie( USES_REGS1 ); #endif /* TABLING */ +static Int p_yapor_workers( USES_REGS1 ); #ifdef YAPOR static Int p_parallel_mode( USES_REGS1 ); static Int p_yapor_start( USES_REGS1 ); -static Int p_yapor_workers( USES_REGS1 ); static Int p_worker( USES_REGS1 ); static Int p_parallel_new_answer( USES_REGS1 ); static Int p_parallel_get_answers( USES_REGS1 ); @@ -199,6 +199,7 @@ struct page_statistics { *******************************/ void Yap_init_optyap_preds(void) { + Yap_InitCPred("$c_yapor_workers", 1, p_yapor_workers, SafePredFlag|SyncPredFlag); #ifdef TABLING Yap_InitCPred("freeze_choice_point", 1, p_freeze_choice_point, SafePredFlag|SyncPredFlag); Yap_InitCPred("wake_choice_point", 1, p_wake_choice_point, SafePredFlag|SyncPredFlag); @@ -227,7 +228,6 @@ predicates. The predicates remain as tabled predicates. #ifdef YAPOR Yap_InitCPred("parallel_mode", 1, p_parallel_mode, SafePredFlag|SyncPredFlag); Yap_InitCPred("$c_yapor_start", 0, p_yapor_start, SafePredFlag|SyncPredFlag); - Yap_InitCPred("$c_yapor_workers", 1, p_yapor_workers, SafePredFlag|SyncPredFlag); Yap_InitCPred("$c_worker", 0, p_worker, SafePredFlag|SyncPredFlag); Yap_InitCPred("$c_parallel_new_answer", 1, p_parallel_new_answer, SafePredFlag|SyncPredFlag); Yap_InitCPred("$c_parallel_get_answers", 1, p_parallel_get_answers, SafePredFlag|SyncPredFlag); @@ -841,12 +841,18 @@ static Int p_show_statistics_or( USES_REGS1 ) { PL_release_stream(out); return (TRUE); } + +#else + +static Int p_yapor_workers( USES_REGS1 ) { + return FALSE; +} #endif /* YAPOR */ /********************************** -** OPTYap C Predicates ** + ** OPTYap C Predicates ** **********************************/ #if defined(YAPOR) && defined(TABLING)