This commit is contained in:
Vitor Santos Costa 2018-11-23 14:00:20 +00:00
parent 999de8df19
commit 0230ff35d1
8 changed files with 29 additions and 23 deletions

View File

@ -1745,6 +1745,7 @@ static int legal_env(CELL *ep USES_REGS) {
return (TRUE); return (TRUE);
} }
#if 0
static bool handled_exception(USES_REGS1) { static bool handled_exception(USES_REGS1) {
yamop *pos = NEXTOP(PredDollarCatch->cs.p_code.TrueCodeOfPred, l); yamop *pos = NEXTOP(PredDollarCatch->cs.p_code.TrueCodeOfPred, l);
bool found_handler = false; bool found_handler = false;
@ -1767,6 +1768,8 @@ static bool handled_exception(USES_REGS1) {
return !found_handler; return !found_handler;
} }
#endif
#define ADDBUF( CMD ) { \ #define ADDBUF( CMD ) { \
while (true) { \ while (true) { \
size_t sz = CMD; \ size_t sz = CMD; \

View File

@ -1,7 +1,10 @@
extern "C" {
#include "inline-only.h" #include "inline-only.h"
#define _EXPORT_KERNEL 1 #define _EXPORT_KERNEL 1
}
#include "yapi.hh" #include "yapi.hh"

View File

@ -13,21 +13,22 @@
#include <vector> #include <vector>
extern "C" { extern "C" {
#include "YapConfig.h" #include "YapConfig.h"
} }
#if HAVE_GMPXX_H || defined(__ANDROID__)
#include <gmpxx.h> #include <gmpxx.h>
#elif HAVE_GMP_H
#include <gmp.h>
#endif
/*! /*!
* *
* @ingroup fli_c_cxx * @ingroup fli_c_cxx
* @defgroup yap-cplus-interface An object oriented interface for YAP. * @defgroup yap-cplus-interface An object oriented interface for YAP.
* *
* @{ 1 * @{
* *
* *
* @brief C++ wrapper to terms, predicates and queries * @brief C++ wrapper to terms, predicates and queries

View File

@ -398,6 +398,8 @@ INLINE_ONLY bool IsBigIntTerm(Term t) {
#if !defined(__cplusplus) #if !defined(__cplusplus)
#include <gmp.h> #include <gmp.h>
#else
#include <gmpxx.h>
#endif #endif

View File

@ -263,9 +263,9 @@ db_open(odbc,Connection,ODBCEntry,User,Password) :-
%% sqlite3 %% sqlite3
db_open(sqlite3,Connection,File,User,Password) :- db_open(sqlite3,Connection,File,User,Password) :-
absolute_file_name(File,DB,[extensions(db),access(write),file_type(myddas),expand(true)]), absolute_file_name(File,Db,[extensions(db),access(write),file_type(myddas),expand(true)]),
'$error_checks'(db_open(sqlite3,Connection,File,User,Password)), '$error_checks'(db_open(sqlite3,Connection,Db,User,Password)),
c_sqlite3_connect(File,User,Password,Con), c_sqlite3_connect(Db,User,Password,Con),
set_value(Connection,Con). set_value(Connection,Con).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

View File

@ -7,13 +7,13 @@
:- begin_tests(sqlite3). :- begin_tests(sqlite3).
:- if( yap_flag(android,true) ). %:- if( yap_flag(android,true) ).
test(open) :- %test(open) :-
db_open(sqlite3, '/data/user/0/pt.up.yap/files/chinook.db', _, _). % db_open(sqlite3, '/data/user/0/pt.up.yap/files/chinook.db', _, _).
:- else. %:- else.
test(open) :- test(open) :-
db_open(sqlite3,dataset('chinook'),_,_). db_open(sqlite3,dataset('chinook'),_,_).
:-endif. %:-endif.
test(schema0, all((Tables ==[(table albums), test(schema0, all((Tables ==[(table albums),
(table artists), (table artists),
@ -40,7 +40,7 @@ test(all_artists, all((
273-'C. Monteverdi, Nigel Rogers - Chiaroscuro; London Baroque; London Cornett & Sackbu', 273-'C. Monteverdi, Nigel Rogers - Chiaroscuro; London Baroque; London Cornett & Sackbu',
274-'Nash Ensemble', 274-'Nash Ensemble',
275-'Philip Glass Ensemble'] ))) :- 275-'Philip Glass Ensemble'] ))) :-
artists(X,Y). findall(X-Y,artists(X,Y),L).
test(cut_artists, true((X-Y == 1-'AC/DC'))) :- test(cut_artists, true((X-Y == 1-'AC/DC'))) :-
artists(X, Y), artists(X, Y),

View File

@ -846,16 +846,12 @@ be lost.
'$scan_number'(ScanNumber), '$scan_number'(ScanNumber),
( ScanNumber == 0 -> Goal = CallNumber ; Goal = ScanNumber ), ( ScanNumber == 0 -> Goal = CallNumber ; Goal = ScanNumber ),
'__NB_setval__'('$debug_status', state(leap, Goal, stop)). '__NB_setval__'('$debug_status', state(leap, Goal, stop)).
'$action'(z,_,CallNumber,_,_,_H) :- !, % 'z zip, fast leap '$action'(z,_,_allNumber,_,_,_H) :- !, % 'z zip, fast leap
'$scan_number'(ScanNumber), '__NB_setval__'('$debug_status', state(zip, 0, stop)).
( ScanNumber == 0 -> Goal = CallNumber ; Goal = ScanNumber ),
'__NB_setval__'('$debug_status', state(zip, Goal, stop)).
% skip first call (for current goal), % skip first call (for current goal),
% stop next time. % stop next time.
'$action'(k,_,CallNumber,_,_,_) :- !, % 'k zip, fast leap '$action'(k,_,_CallNumber,_,_,_) :- !, % 'k zip, fast leap
'$scan_number'(ScanNumber), '__NB_setval__'('$debug_status', state(zip, 0, stop)).
( ScanNumber == 0 -> Goal = CallNumber ; Goal = ScanNumber ),
'__NB_setval__'('$debug_status', state(zip, Goal, ignore)).
% skip first call (for current goal), % skip first call (for current goal),
% stop next time. % stop next time.
'$action'(n,_,_,_,_,_) :- !, % 'n nodebug '$action'(n,_,_,_,_,_) :- !, % 'n nodebug

View File

@ -102,7 +102,8 @@ user:term_expansion(In, Out) :-
if_expansion(In, Out). if_expansion(In, Out).
swi :- catch(current_prolog_flag(dialect, swi), _, fail), !. 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). sicstus :- catch(current_prolog_flag(system_type, _), _, fail).