diff --git a/C/stack.c b/C/stack.c index fb3ca3a6e..bba9ad55d 100644 --- a/C/stack.c +++ b/C/stack.c @@ -1745,6 +1745,7 @@ static int legal_env(CELL *ep USES_REGS) { return (TRUE); } +#if 0 static bool handled_exception(USES_REGS1) { yamop *pos = NEXTOP(PredDollarCatch->cs.p_code.TrueCodeOfPred, l); bool found_handler = false; @@ -1767,6 +1768,8 @@ static bool handled_exception(USES_REGS1) { return !found_handler; } +#endif + #define ADDBUF( CMD ) { \ while (true) { \ size_t sz = CMD; \ diff --git a/CXX/yapi.cpp b/CXX/yapi.cpp index c0859d0dd..cff2c3d47 100644 --- a/CXX/yapi.cpp +++ b/CXX/yapi.cpp @@ -1,7 +1,10 @@ +extern "C" { + #include "inline-only.h" #define _EXPORT_KERNEL 1 +} #include "yapi.hh" diff --git a/CXX/yapi.hh b/CXX/yapi.hh index 599ae7cf1..4154cc55b 100755 --- a/CXX/yapi.hh +++ b/CXX/yapi.hh @@ -13,21 +13,22 @@ #include extern "C" { + #include "YapConfig.h" + } -#if HAVE_GMPXX_H || defined(__ANDROID__) #include -#elif HAVE_GMP_H -#include -#endif + + + /*! * * @ingroup fli_c_cxx * @defgroup yap-cplus-interface An object oriented interface for YAP. * - * @{ +1 * @{ * * * @brief C++ wrapper to terms, predicates and queries diff --git a/H/TermExt.h b/H/TermExt.h index d6ffa0f79..fed59fcbd 100755 --- a/H/TermExt.h +++ b/H/TermExt.h @@ -398,6 +398,8 @@ INLINE_ONLY bool IsBigIntTerm(Term t) { #if !defined(__cplusplus) #include +#else +#include #endif diff --git a/H/YapText.h b/H/YapText.h index 1fef851a2..7f76514f3 100644 --- a/H/YapText.h +++ b/H/YapText.h @@ -833,7 +833,7 @@ static inline Term Yap_CharsToTBQ(const char *s, Term mod, static inline Atom Yap_ListOfAtomsToAtom(Term t0 USES_REGS) { seq_tv_t inp, out; inp.val.t = t0; - inp.type = YAP_STRING_ATOMS; + inp.type = YAP_STRING_ATOMS|YAP_STRING_CODES; out.type = YAP_STRING_ATOM; out.val.uc = NULL; out.enc = ENC_ISO_UTF8; @@ -845,7 +845,7 @@ static inline Atom Yap_ListOfAtomsToAtom(Term t0 USES_REGS) { static inline Term Yap_ListOfAtomsToNumber(Term t0 USES_REGS) { seq_tv_t inp, out; inp.val.t = t0; - inp.type = YAP_STRING_ATOMS; + inp.type = YAP_STRING_ATOMS|YAP_STRING_CODES; out.type = YAP_STRING_INT | YAP_STRING_FLOAT | YAP_STRING_BIG | YAP_STRING_TERM; out.val.uc = NULL; @@ -858,7 +858,7 @@ static inline Term Yap_ListOfAtomsToNumber(Term t0 USES_REGS) { static inline Term Yap_ListOfAtomsToString(Term t0 USES_REGS) { seq_tv_t inp, out; inp.val.t = t0; - inp.type = YAP_STRING_ATOMS; + inp.type = YAP_STRING_ATOMS|YAP_STRING_CODES; out.type = YAP_STRING_STRING; out.val.uc = NULL; out.enc = ENC_ISO_UTF8; @@ -870,7 +870,7 @@ static inline Term Yap_ListOfAtomsToString(Term t0 USES_REGS) { static inline Atom Yap_ListOfCodesToAtom(Term t0 USES_REGS) { seq_tv_t inp, out; inp.val.t = t0; - inp.type = YAP_STRING_CODES; + inp.type = YAP_STRING_CODES|YAP_STRING_ATOMS; out.type = YAP_STRING_ATOM; out.val.uc = NULL; out.enc = ENC_ISO_UTF8; @@ -882,7 +882,7 @@ static inline Atom Yap_ListOfCodesToAtom(Term t0 USES_REGS) { static inline Term Yap_ListOfCodesToNumber(Term t0 USES_REGS) { seq_tv_t inp, out; inp.val.t = t0; - inp.type = YAP_STRING_CODES; + inp.type = YAP_STRING_CODES|YAP_STRING_ATOMS; out.type = YAP_STRING_INT | YAP_STRING_FLOAT | YAP_STRING_BIG; out.enc = ENC_ISO_UTF8; out.val.uc = NULL; @@ -895,7 +895,7 @@ static inline Term Yap_ListOfCodesToString(Term t0 USES_REGS) { seq_tv_t inp, out; inp.val.t = t0; - inp.type = YAP_STRING_CODES; + inp.type = YAP_STRING_CODES|YAP_STRING_ATOMS; out.val.uc = NULL; out.type = YAP_STRING_STRING; out.enc = ENC_ISO_UTF8; diff --git a/packages/myddas/pl/myddas.ypp b/packages/myddas/pl/myddas.ypp index d8ac3e667..dcc33c499 100644 --- a/packages/myddas/pl/myddas.ypp +++ b/packages/myddas/pl/myddas.ypp @@ -263,9 +263,9 @@ db_open(odbc,Connection,ODBCEntry,User,Password) :- %% sqlite3 db_open(sqlite3,Connection,File,User,Password) :- - absolute_file_name(File,DB,[extensions(db),access(write),file_type(myddas),expand(true)]), - '$error_checks'(db_open(sqlite3,Connection,File,User,Password)), - c_sqlite3_connect(File,User,Password,Con), + absolute_file_name(File,Db,[extensions(db),access(write),file_type(myddas),expand(true)]), + '$error_checks'(db_open(sqlite3,Connection,Db,User,Password)), + c_sqlite3_connect(Db,User,Password,Con), set_value(Connection,Con). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/packages/myddas/sqlite3/sqlitest.yap b/packages/myddas/sqlite3/sqlitest.yap index 531c48bbf..3a99d7cb2 100644 --- a/packages/myddas/sqlite3/sqlitest.yap +++ b/packages/myddas/sqlite3/sqlitest.yap @@ -7,13 +7,13 @@ :- begin_tests(sqlite3). -:- if( yap_flag(android,true) ). -test(open) :- - db_open(sqlite3, '/data/user/0/pt.up.yap/files/chinook.db', _, _). -:- else. +%:- if( yap_flag(android,true) ). +%test(open) :- +% db_open(sqlite3, '/data/user/0/pt.up.yap/files/chinook.db', _, _). +%:- else. test(open) :- db_open(sqlite3,dataset('chinook'),_,_). -:-endif. +%:-endif. test(schema0, all((Tables ==[(table albums), (table artists), @@ -40,7 +40,7 @@ test(all_artists, all(( 273-'C. Monteverdi, Nigel Rogers - Chiaroscuro; London Baroque; London Cornett & Sackbu', 274-'Nash Ensemble', 275-'Philip Glass Ensemble'] ))) :- - artists(X,Y). + findall(X-Y,artists(X,Y),L). test(cut_artists, true((X-Y == 1-'AC/DC'))) :- artists(X, Y), diff --git a/pl/debug.yap b/pl/debug.yap index 5a8575fb9..04223319d 100644 --- a/pl/debug.yap +++ b/pl/debug.yap @@ -846,16 +846,12 @@ be lost. '$scan_number'(ScanNumber), ( ScanNumber == 0 -> Goal = CallNumber ; Goal = ScanNumber ), '__NB_setval__'('$debug_status', state(leap, Goal, stop)). -'$action'(z,_,CallNumber,_,_,_H) :- !, % 'z zip, fast leap - '$scan_number'(ScanNumber), - ( ScanNumber == 0 -> Goal = CallNumber ; Goal = ScanNumber ), - '__NB_setval__'('$debug_status', state(zip, Goal, stop)). +'$action'(z,_,_allNumber,_,_,_H) :- !, % 'z zip, fast leap + '__NB_setval__'('$debug_status', state(zip, 0, stop)). % skip first call (for current goal), % stop next time. -'$action'(k,_,CallNumber,_,_,_) :- !, % 'k zip, fast leap - '$scan_number'(ScanNumber), - ( ScanNumber == 0 -> Goal = CallNumber ; Goal = ScanNumber ), - '__NB_setval__'('$debug_status', state(zip, Goal, ignore)). +'$action'(k,_,_CallNumber,_,_,_) :- !, % 'k zip, fast leap + '__NB_setval__'('$debug_status', state(zip, 0, stop)). % skip first call (for current goal), % stop next time. '$action'(n,_,_,_,_,_) :- !, % 'n nodebug diff --git a/swi/library/plunit.pl b/swi/library/plunit.pl index 73aef14d9..e6b4586dd 100644 --- a/swi/library/plunit.pl +++ b/swi/library/plunit.pl @@ -102,7 +102,8 @@ user:term_expansion(In, Out) :- if_expansion(In, Out). swi :- catch(current_prolog_flag(dialect, swi), _, fail), !. -swi :- catch(current_prolog_flag(dialect, yap), _, fail). +swi :- catch(current_prolog_flag(dialect, yap), _, fail), !. +yap :- catch(current_prolog_flag(dialect, yap), _, fail), !. sicstus :- catch(current_prolog_flag(system_type, _), _, fail).