Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3

This commit is contained in:
Vítor Santos Costa 2012-03-06 14:12:39 +00:00
commit fd0cf6ee14
13 changed files with 14819 additions and 4121 deletions

View File

@ -3034,14 +3034,6 @@ Yap_absmi(int inp)
if (LOCAL_PrologMode & (AbortMode|InterruptMode)) { if (LOCAL_PrologMode & (AbortMode|InterruptMode)) {
CreepFlag = CalculateStackGap(); CreepFlag = CalculateStackGap();
UNLOCK(LOCAL_SignalLock); UNLOCK(LOCAL_SignalLock);
/* same instruction */
if (LOCAL_PrologMode & InterruptMode) {
LOCAL_PrologMode &= ~InterruptMode;
SET_ASP(YREG, E_CB*sizeof(CELL));
saveregs();
Yap_ProcessSIGINT();
setregs();
}
JMPNext(); JMPNext();
} }
UNLOCK(LOCAL_SignalLock); UNLOCK(LOCAL_SignalLock);
@ -8562,7 +8554,7 @@ Yap_absmi(int inp)
d0 = XREG(PREG->u.xl.x); d0 = XREG(PREG->u.xl.x);
deref_head(d0, atom_x_unk); deref_head(d0, atom_x_unk);
atom_x_nvar: atom_x_nvar:
if (IsAtomTerm(d0)) { if (IsAtomTerm(d0) && !IsBlob(AtomOfTerm(d0))) {
PREG = NEXTOP(PREG, xl); PREG = NEXTOP(PREG, xl);
GONext(); GONext();
} }
@ -8586,7 +8578,7 @@ Yap_absmi(int inp)
d0 = *pt0; d0 = *pt0;
deref_head(d0, atom_y_unk); deref_head(d0, atom_y_unk);
atom_y_nvar: atom_y_nvar:
if (IsAtomTerm(d0)) { if (IsAtomTerm(d0) && !IsBlob(AtomOfTerm(d0))) {
PREG = NEXTOP(PREG, yl); PREG = NEXTOP(PREG, yl);
GONext(); GONext();
} }

View File

@ -74,18 +74,6 @@ LeaveGrowMode(prolog_exec_mode grow_mode)
{ {
CACHE_REGS CACHE_REGS
LOCAL_PrologMode &= ~grow_mode; LOCAL_PrologMode &= ~grow_mode;
if (LOCAL_PrologMode & AbortMode) {
CACHE_REGS
LOCAL_PrologMode &= ~AbortMode;
Yap_Error(PURE_ABORT, TermNil, "");
/* in case someone mangles the P register */
save_machine_regs();
#if _MSC_VER || defined(__MINGW32__)
/* don't even think about trying this */
#else
Yap_RestartYap( 1 );
#endif
}
} }
@ -822,10 +810,10 @@ static_growheap(long size, int fix_code, struct intermediates *cip, tr_fr_ptr *o
UNLOCK(LOCAL_SignalLock); UNLOCK(LOCAL_SignalLock);
} }
ASP -= 256; ASP -= 256;
YAPEnterCriticalSection();
LOCAL_TrDiff = LOCAL_LDiff = LOCAL_GDiff = LOCAL_GDiff0 = LOCAL_DelayDiff = LOCAL_BaseDiff = size; LOCAL_TrDiff = LOCAL_LDiff = LOCAL_GDiff = LOCAL_GDiff0 = LOCAL_DelayDiff = LOCAL_BaseDiff = size;
LOCAL_XDiff = LOCAL_HDiff = 0; LOCAL_XDiff = LOCAL_HDiff = 0;
LOCAL_GSplit = NULL; LOCAL_GSplit = NULL;
YAPEnterCriticalSection();
SetHeapRegs(FALSE PASS_REGS); SetHeapRegs(FALSE PASS_REGS);
MoveLocalAndTrail( PASS_REGS1 ); MoveLocalAndTrail( PASS_REGS1 );
if (fix_code) { if (fix_code) {
@ -849,10 +837,10 @@ static_growheap(long size, int fix_code, struct intermediates *cip, tr_fr_ptr *o
AdjustStacksAndTrail(0, FALSE PASS_REGS); AdjustStacksAndTrail(0, FALSE PASS_REGS);
} }
AdjustRegs(MaxTemps PASS_REGS); AdjustRegs(MaxTemps PASS_REGS);
YAPLeaveCriticalSection();
ASP += 256; ASP += 256;
if (minimal_request) if (minimal_request)
Yap_AllocHole(minimal_request, size); Yap_AllocHole(minimal_request, size);
YAPLeaveCriticalSection();
growth_time = Yap_cputime()-start_growth_time; growth_time = Yap_cputime()-start_growth_time;
LOCAL_total_heap_overflow_time += growth_time; LOCAL_total_heap_overflow_time += growth_time;
if (gc_verbose) { if (gc_verbose) {
@ -1406,9 +1394,8 @@ growatomtable( USES_REGS1 )
if (HeapTop + sizeof(YAP_SEG_SIZE) > HeapLim - MinHeapGap) { if (HeapTop + sizeof(YAP_SEG_SIZE) > HeapLim - MinHeapGap) {
/* make sure there is no heap overflow */ /* make sure there is no heap overflow */
int res; int res;
YAPEnterCriticalSection();
res = do_growheap(FALSE, 0, NULL, NULL, NULL, NULL PASS_REGS); res = do_growheap(FALSE, 0, NULL, NULL, NULL, NULL PASS_REGS);
YAPLeaveCriticalSection();
return res; return res;
} else { } else {
return TRUE; return TRUE;
@ -1744,7 +1731,9 @@ static int do_growtrail(long size, int contiguous_only, int in_parser, tr_fr_ptr
#if USE_SYSTEM_MALLOC #if USE_SYSTEM_MALLOC
execute_growstack(size, TRUE, in_parser, old_trp, tksp, vep PASS_REGS); execute_growstack(size, TRUE, in_parser, old_trp, tksp, vep PASS_REGS);
#else #else
YAPEnterCriticalSection();
if (!Yap_ExtendWorkSpace(size)) { if (!Yap_ExtendWorkSpace(size)) {
YAPLeaveCriticalSection();
LOCAL_ErrorMessage = NULL; LOCAL_ErrorMessage = NULL;
if (contiguous_only) { if (contiguous_only) {
/* I can't expand in this case */ /* I can't expand in this case */
@ -1753,7 +1742,6 @@ static int do_growtrail(long size, int contiguous_only, int in_parser, tr_fr_ptr
} }
execute_growstack(size, TRUE, in_parser, old_trp, tksp, vep PASS_REGS); execute_growstack(size, TRUE, in_parser, old_trp, tksp, vep PASS_REGS);
} else { } else {
YAPEnterCriticalSection();
if (in_parser) { if (in_parser) {
LOCAL_TrDiff = LOCAL_LDiff = LOCAL_GDiff = LOCAL_BaseDiff = LOCAL_DelayDiff = LOCAL_XDiff = LOCAL_HDiff = LOCAL_GDiff0 = 0; LOCAL_TrDiff = LOCAL_LDiff = LOCAL_GDiff = LOCAL_BaseDiff = LOCAL_DelayDiff = LOCAL_XDiff = LOCAL_HDiff = LOCAL_GDiff0 = 0;
AdjustScannerStacks(tksp, vep PASS_REGS); AdjustScannerStacks(tksp, vep PASS_REGS);

View File

@ -4148,8 +4148,9 @@ LeaveGCMode( USES_REGS1 )
LOCAL_PrologMode &= ~GCMode; LOCAL_PrologMode &= ~GCMode;
if (LOCAL_PrologMode & AbortMode) { if (LOCAL_PrologMode & AbortMode) {
LOCAL_PrologMode &= ~AbortMode; LOCAL_PrologMode &= ~AbortMode;
Yap_Error(PURE_ABORT, TermNil, ""); /* in case someone mangles the P register */
P = FAILCODE; Yap_Error(PURE_ABORT, TermNil, "abort from console");
Yap_RestartYap( 1 );
} }
} }

View File

@ -47,7 +47,7 @@ p_atom( USES_REGS1 )
d0 = ARG1; d0 = ARG1;
deref_head(d0, atom_unk); deref_head(d0, atom_unk);
atom_nvar: atom_nvar:
if (IsAtomTerm(d0)) { if (IsAtomTerm(d0) && !IsBlob(AtomOfTerm(d0))) {
return(TRUE); return(TRUE);
} }
else { else {

View File

@ -1553,15 +1553,14 @@ void (*handler)(int);
static int static int
InteractSIGINT(int ch) { InteractSIGINT(int ch) {
CACHE_REGS CACHE_REGS
LOCAL_PrologMode |= AsyncIntMode;
switch (ch) { switch (ch) {
case 'a': case 'a':
/* abort computation */ /* abort computation */
if (LOCAL_PrologMode & (GCMode|ConsoleGetcMode|GrowStackMode|GrowHeapMode)) { if (LOCAL_PrologMode & (GCMode|ConsoleGetcMode|CritMode)) {
LOCAL_PrologMode |= AbortMode; LOCAL_PrologMode |= AbortMode;
return -1;
} else { } else {
Yap_Error(PURE_ABORT, TermNil, "abort from console"); Yap_Error(PURE_ABORT, TermNil, "abort from console");
/* in case someone mangles the P register */
} }
LOCAL_PrologMode &= ~AsyncIntMode; LOCAL_PrologMode &= ~AsyncIntMode;
Yap_RestartYap( 1 ); Yap_RestartYap( 1 );
@ -1569,44 +1568,36 @@ InteractSIGINT(int ch) {
case 'b': case 'b':
/* continue */ /* continue */
Yap_signal (YAP_BREAK_SIGNAL); Yap_signal (YAP_BREAK_SIGNAL);
LOCAL_PrologMode &= ~AsyncIntMode;
return 1; return 1;
case 'c': case 'c':
/* continue */ /* continue */
return 1; return 1;
case 'd': case 'd':
Yap_signal (YAP_DEBUG_SIGNAL); Yap_signal (YAP_DEBUG_SIGNAL);
LOCAL_PrologMode &= ~AsyncIntMode;
/* enter debug mode */ /* enter debug mode */
return 1; return 1;
case 'e': case 'e':
/* exit */ /* exit */
LOCAL_PrologMode &= ~AsyncIntMode;
Yap_exit(0); Yap_exit(0);
return -1; return -1;
case 'g': case 'g':
/* exit */ /* exit */
Yap_signal (YAP_STACK_DUMP_SIGNAL); Yap_signal (YAP_STACK_DUMP_SIGNAL);
LOCAL_PrologMode &= ~AsyncIntMode;
return -1; return -1;
case 't': case 't':
/* start tracing */ /* start tracing */
Yap_signal (YAP_TRACE_SIGNAL); Yap_signal (YAP_TRACE_SIGNAL);
LOCAL_PrologMode &= ~AsyncIntMode;
return 1; return 1;
#ifdef LOW_LEVEL_TRACER #ifdef LOW_LEVEL_TRACER
case 'T': case 'T':
toggle_low_level_trace(); toggle_low_level_trace();
LOCAL_PrologMode &= ~AsyncIntMode;
return 1; return 1;
#endif #endif
case 's': case 's':
/* show some statistics */ /* show some statistics */
Yap_signal (YAP_STATISTICS_SIGNAL); Yap_signal (YAP_STATISTICS_SIGNAL);
LOCAL_PrologMode &= ~AsyncIntMode;
return 1; return 1;
case EOF: case EOF:
LOCAL_PrologMode &= ~AsyncIntMode;
return(0); return(0);
break; break;
case 'h': case 'h':
@ -1617,7 +1608,6 @@ InteractSIGINT(int ch) {
fprintf(GLOBAL_stderr, " a for abort\n c for continue\n d for debug\n"); fprintf(GLOBAL_stderr, " a for abort\n c for continue\n d for debug\n");
fprintf(GLOBAL_stderr, " e for exit\n g for stack dump\n s for statistics\n t for trace\n"); fprintf(GLOBAL_stderr, " e for exit\n g for stack dump\n s for statistics\n t for trace\n");
fprintf(GLOBAL_stderr, " b for break\n"); fprintf(GLOBAL_stderr, " b for break\n");
LOCAL_PrologMode &= ~AsyncIntMode;
return(0); return(0);
} }
} }
@ -1631,19 +1621,15 @@ ProcessSIGINT(void)
{ {
int ch, out; int ch, out;
LOCAL_PrologMode |= AsyncIntMode;
do { do {
ch = Yap_GetCharForSIGINT(); ch = Yap_GetCharForSIGINT();
} while (!(out = InteractSIGINT(ch))); } while (!(out = InteractSIGINT(ch)));
LOCAL_PrologMode &= ~AsyncIntMode;
LOCAL_PrologMode &= ~InterruptMode;
return(out); return(out);
} }
int
Yap_ProcessSIGINT(void)
{
return ProcessSIGINT();
}
#if !_MSC_VER && !defined(__MINGW32__) #if !_MSC_VER && !defined(__MINGW32__)
#if HAVE_SIGNAL #if HAVE_SIGNAL
@ -1662,6 +1648,7 @@ HandleSIGINT (int sig)
#endif #endif
{ {
CACHE_REGS CACHE_REGS
/* fprintf(stderr,"mode = %x\n",LOCAL_PrologMode); */
my_signal(SIGINT, HandleSIGINT); my_signal(SIGINT, HandleSIGINT);
/* do this before we act */ /* do this before we act */
#if HAVE_ISATTY #if HAVE_ISATTY
@ -1673,8 +1660,9 @@ HandleSIGINT (int sig)
if (LOCAL_InterruptsDisabled) { if (LOCAL_InterruptsDisabled) {
return; return;
} }
if (LOCAL_PrologMode & (CritMode|ConsoleGetcMode)) { if (LOCAL_PrologMode & ConsoleGetcMode) {
LOCAL_PrologMode |= InterruptMode; LOCAL_PrologMode |= InterruptMode;
return;
} }
#ifdef HAVE_SETBUF #ifdef HAVE_SETBUF
/* make sure we are not waiting for the end of line */ /* make sure we are not waiting for the end of line */

View File

@ -4223,10 +4223,9 @@ camacho_dum( USES_REGS1 )
int int
Yap_IsListTerm(Term t) Yap_IsListTerm(Term t)
{ {
while (!IsVarTerm(t) && IsPairTerm(t)) { Term *tailp;
t = TailOfTerm(t); Yap_SkipList(&t, &tailp);
} return *tailp == TermNil;
return t == TermNil;
} }
static Int static Int

15
H/Yap.h
View File

@ -615,10 +615,6 @@ typedef enum
LOCAL_CritLocks--; \ LOCAL_CritLocks--; \
if (!LOCAL_CritLocks) { \ if (!LOCAL_CritLocks) { \
LOCAL_PrologMode &= ~CritMode; \ LOCAL_PrologMode &= ~CritMode; \
if (LOCAL_PrologMode & InterruptMode) { \
LOCAL_PrologMode &= ~InterruptMode; \
Yap_ProcessSIGINT(); \
} \
if (LOCAL_PrologMode & AbortMode) { \ if (LOCAL_PrologMode & AbortMode) { \
LOCAL_PrologMode &= ~AbortMode; \ LOCAL_PrologMode &= ~AbortMode; \
Yap_Error(PURE_ABORT, 0, ""); \ Yap_Error(PURE_ABORT, 0, ""); \
@ -636,13 +632,10 @@ typedef enum
#define YAPLeaveCriticalSection() \ #define YAPLeaveCriticalSection() \
{ \ { \
LOCAL_PrologMode &= ~CritMode; \ LOCAL_PrologMode &= ~CritMode; \
if (LOCAL_PrologMode & InterruptMode) { \
LOCAL_PrologMode &= ~InterruptMode; \
Yap_ProcessSIGINT(); \
} \
if (LOCAL_PrologMode & AbortMode) { \ if (LOCAL_PrologMode & AbortMode) { \
LOCAL_PrologMode &= ~AbortMode; \ LOCAL_PrologMode &= ~AbortMode; \
Yap_Error(PURE_ABORT, 0, ""); \ Yap_Error(PURE_ABORT, 0, ""); \
Yap_RestartYap( 1 ); \
} \ } \
/* UNLOCK(BGL); */ \ /* UNLOCK(BGL); */ \
} }
@ -657,13 +650,9 @@ typedef enum
LOCAL_CritLocks--; \ LOCAL_CritLocks--; \
if (!LOCAL_CritLocks) { \ if (!LOCAL_CritLocks) { \
LOCAL_PrologMode &= ~CritMode; \ LOCAL_PrologMode &= ~CritMode; \
if (LOCAL_PrologMode & InterruptMode) { \
LOCAL_PrologMode &= ~InterruptMode; \
Yap_ProcessSIGINT(); \
} \
if (LOCAL_PrologMode & AbortMode) { \ if (LOCAL_PrologMode & AbortMode) { \
LOCAL_PrologMode &= ~AbortMode; \ LOCAL_PrologMode &= ~AbortMode; \
Yap_Error(PURE_ABORT, 0, ""); \ Yap_RestartYap( 1 ); \
} \ } \
} \ } \
} }

View File

@ -356,7 +356,6 @@ void STD_PROTO(Yap_InitSysbits,(void));
void STD_PROTO(Yap_InitSysPreds,(void)); void STD_PROTO(Yap_InitSysPreds,(void));
void STD_PROTO(Yap_InitTime,(void)); void STD_PROTO(Yap_InitTime,(void));
int STD_PROTO(Yap_TrueFileName, (char *, char *, int)); int STD_PROTO(Yap_TrueFileName, (char *, char *, int));
int STD_PROTO(Yap_ProcessSIGINT,(void));
double STD_PROTO(Yap_random, (void)); double STD_PROTO(Yap_random, (void));
#ifdef _WIN32 #ifdef _WIN32
char *STD_PROTO(Yap_RegistryGetString,(char *)); char *STD_PROTO(Yap_RegistryGetString,(char *));

18172
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -241,7 +241,7 @@ AC_ARG_WITH(R,
else else
yap_cv_R=$with_R yap_cv_R=$with_R
fi, fi,
[yap_cv_R=yes]) [yap_cv_R=no])
dnl best test we could do. dnl best test we could do.
AC_ARG_WITH(minisat, AC_ARG_WITH(minisat,
@ -257,28 +257,73 @@ AC_ARG_WITH(minisat,
AC_ARG_WITH(cudd, AC_ARG_WITH(cudd,
[ --with-cudd[=DIR] use CUDD package in DIR], [ --with-cudd[=DIR] use CUDD package in DIR],
if test "$withval" = yes; then yap_cv_cudd="$withval"
if test "$prefix" = "NONE"; then if test "$withval" != no; then
yap_cv_cudd=/usr/local/cudd oldlibs="$LIBS"
if test "$withval" != "yes"; then
if test -d "$yap_cv_cudd"/include/cudd; then
CUDD_CPPFLAGS="-I $yap_cv_cudd/include/cudd"
else else
yap_cv_cudd=$prefix/cudd; CUDD_CPPFLAGS="-I $yap_cv_cudd/include"
fi fi
CUDD_LDFLAGS="-L $yap_cv_cudd/lib -lcudd -lmtr -lst -lutil -lepd" cudd_dir="$yap_cv_cudd"
CUDD_CPPFLAGS="-I $yap_cv_cudd/include" elif test -e /usr/include/cudd; then
elif test "$withval" = no; then
yap_cv_cudd=no
elif test "$withval" = /opt/local; then
yap_cv_cudd=$with_cudd
CUDD_LDFLAGS="-L/opt/local/lib/cudd -lcudd"
CUDD_CPPFLAGS="-I /opt/local/include/cudd"
elif test "$withval" = /usr; then
yap_cv_cudd=$with_cudd
CUDD_LDFLAGS="-lcudd -lmtr -lcuddst -lcuddutil -lepd"
CUDD_CPPFLAGS="-I /usr/include/cudd" CUDD_CPPFLAGS="-I /usr/include/cudd"
cudd_dir="$withval"
elif test "$prefix" != "NONE"; then
if test -d "$prefix"/include/cudd; then
CUDD_CPPFLAGS="-I $prefix/include/cudd"
else else
yap_cv_cudd=$with_cudd CUDD_CPPFLAGS="-I $prefix/include"
CUDD_LDFLAGS="$yap_cv_cudd/cudd/libcudd.a $yap_cv_cudd/mtr/libmtr.a $yap_cv_cudd/st/libst.a $yap_cv_cudd/util/libutil.a $yap_cv_cudd/epd/libepd.a" fi
CUDD_CPPFLAGS="-I $yap_cv_cudd/include" cudd_dir="$prefix"
else
if test -d /usr/local/include/cudd; then
CUDD_CPPFLAGS="-I /usr/local/include/cudd"
fi
cudd_dir=/usr/local
fi
dnl cudd can be most everywhere
if test -d "$cudd_dir/lib64/cudd" -a "$YAP_TARGET" = amd64; then
LIBS="$LIBS -L $cudd_dir/lib64/cudd"
elif test -d "$cudd_dir/lib64" -a "$YAP_TARGET" = amd64; then
LIBS="$LIBS -L $cudd_dir/lib64"
elif test -d "$cudd_dir/lib/cudd"; then
LIBS="$LIBS -L $cudd_dir/lib/cudd"
elif test -d "$cudd_dir/lib"; then
LIBS="$LIBS -L $cudd_dir/lib"
fi
if test -d "$cudd_dir/util"; then
LIBS="$LIBS -L $cudd_dir/util"
fi
AC_SEARCH_LIBS(util_print_cpu_stats, [cuddutil util])
if test -d "$cudd_dir/st"; then
LIBS="$LIBS -L $cudd_dir/st"
fi
AC_SEARCH_LIBS(st_insert, [cuddst st])
if test -d "$cudd_dir/epd"; then
LIBS="$LIBS -L $cudd_dir/epd"
fi
AC_SEARCH_LIBS(EpdAdd, epd)
if test -d "$cudd_dir/mtr"; then
LIBS="$LIBS -L $cudd_dir/mtr"
fi
AC_SEARCH_LIBS(Mtr_InitTree, [mtr])
if test -d "$cudd_dir/cudd"; then
LIBS="$LIBS -L $cudd_dir/cudd"
fi
AC_SEARCH_LIBS(Cudd_Init, [cudd], [cudd_installed="yes"], [cudd_installed="no"])
if test "$cudd_installed" = yes; then
CUDD_LDFLAGS="$LIBS"
else
cat << EOF
##################################################################
# ERROR: Could not find cudd library. Either I don't have the
# correct path, or CUDD is installed in some strange way
##################################################################
EOF
fi
LIBS="$oldlibs"
fi, fi,
[yap_cv_cudd=no]) [yap_cv_cudd=no])
@ -811,49 +856,24 @@ dnl fi
if test "$yap_cv_myddas" != "no" if test "$yap_cv_myddas" != "no"
then then
dnl check for mysql dnl check for mysql
AC_MSG_CHECKING(for main in -lmysqlclient) AC_SEARCH_LIBS(mysql_init, [mysqlclient], [yap_cv_mysql="yes"], [yap_cv_mysql="no"])
AC_CACHE_VAL(yap_cv_mysql,[
AC_TRY_COMPILE(
#include <mysql/mysql.h>
#include <stdio.h>
,
MYSQL *conn;
conn = mysql_init(NULL);
,
yap_cv_mysql=yes,yap_cv_mysql=no)])
AC_MSG_RESULT($yap_cv_mysql)
if test "$yap_cv_mysql" = yes if test "$yap_cv_mysql" = yes
then then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_MYSQL" YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_MYSQL"
LIBS="$LIBS -L${yap_cv_myddas}/lib/mysql -lmysqlclient "
fi fi
dnl check for odbc dnl check for odbc
AC_MSG_CHECKING(for main in -lodbc) case "$target_os" in
AC_CACHE_VAL(yap_cv_odbc,[ *darwin*)
AC_TRY_COMPILE( LIBS="$LIBS -framework CoreFoundation"
#include <sql.h> ;;
#include <sqlucode.h> **)
#include <stdio.h> ;;
, esac
SQLHENV henv; AC_SEARCH_LIBS(SQLAllocHandle, [odbc], [yap_cv_odbc="yes"], [yap_cv_odbc="no"])
SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv);
,
yap_cv_odbc=yes,yap_cv_odbc=no)])
AC_MSG_RESULT($yap_cv_odbc)
if test "$yap_cv_odbc" = yes if test "$yap_cv_odbc" = yes
then then
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_ODBC" YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_ODBC"
case "$target_os" in
*darwin*)
LIBS="$LIBS -lodbc -framework CoreFoundation"
;;
**)
LIBS="$LIBS -lodbc"
;;
esac
fi
fi fi
if test "$myddasstats" = "yes" if test "$myddasstats" = "yes"
@ -866,6 +886,8 @@ if test "$myddastoplevel" = "yes"
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_TOP_LEVEL" YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_TOP_LEVEL"
fi fi
fi
if test "$threads" = yes if test "$threads" = yes
then then
AC_CHECK_LIB(pthread,pthread_create) AC_CHECK_LIB(pthread,pthread_create)

View File

@ -602,10 +602,13 @@ raw_read2(ReadData _PL_rd ARG_LD)
discardBuffer(cbuf); discardBuffer(cbuf);
setErrorLocation(pos, _PL_rd); setErrorLocation(pos, _PL_rd);
rawSyntaxError("end_of_file_in_block_comment"); rawSyntaxError("end_of_file_in_block_comment");
#ifndef __YAP_PROLOG__
/* YAP does not support comment levels in original scanner */
case '*': case '*':
if ( last == '/' ) if ( last == '/' )
level++; level++;
break; break;
#endif
case '/': case '/':
if ( last == '*' && if ( last == '*' &&
(--level == 0 || _PL_rd->strictness) ) (--level == 0 || _PL_rd->strictness) )

View File

@ -293,11 +293,16 @@ use_module(M,F,Is) :-
!. !.
'$reset_if'(OldIfLevel) :- '$reset_if'(OldIfLevel) :-
catch(nb_getval('$if_level',OldIncludeLevel),_,fail), !, catch(nb_getval('$if_level',OldIfLevel),_,fail), !,
nb_setval('$if_level',0). nb_setval('$if_level',0).
'$reset_if'(0) :- '$reset_if'(0) :-
nb_setval('$if_level',0). nb_setval('$if_level',0).
'$get_if'(Level0) :-
catch(nb_getval('$if_level',Level),_,fail), !,
Level0 = Level.
'$get_if'(0).
'$bind_module'(_, load_files). '$bind_module'(_, load_files).
'$bind_module'(Mod, use_module(Mod)). '$bind_module'(Mod, use_module(Mod)).
@ -894,7 +899,7 @@ absolute_file_name(File,Opts,TrueFileName) :-
% %
'$if'(_,top) :- !, fail. '$if'(_,top) :- !, fail.
'$if'(Goal,_) :- '$if'(Goal,_) :-
nb_getval('$if_level',Level0), '$get_if'(Level0),
Level is Level0 + 1, Level is Level0 + 1,
nb_setval('$if_level',Level), nb_setval('$if_level',Level),
nb_getval('$endif',OldEndif), nb_getval('$endif',OldEndif),
@ -919,7 +924,7 @@ absolute_file_name(File,Opts,TrueFileName) :-
'$else'(top) :- !, fail. '$else'(top) :- !, fail.
'$else'(_) :- '$else'(_) :-
nb_getval('$if_level',0), !, '$get_if'(0), !,
'$do_error'(context_error(no_if),(:- else)). '$do_error'(context_error(no_if),(:- else)).
% we have done an if, so just skip % we have done an if, so just skip
'$else'(_) :- '$else'(_) :-
@ -927,14 +932,14 @@ absolute_file_name(File,Opts,TrueFileName) :-
nb_setval('$if_skip_mode',skip). nb_setval('$if_skip_mode',skip).
% we can try the elif % we can try the elif
'$else'(_) :- '$else'(_) :-
nb_getval('$if_level',Level), '$get_if'(Level),
nb_getval('$endif',elif(Level,OldEndif,Mode)), nb_getval('$endif',elif(Level,OldEndif,Mode)),
nb_setval('$endif',endif(Level,OldEndif,Mode)), nb_setval('$endif',endif(Level,OldEndif,Mode)),
nb_setval('$if_skip_mode',run). nb_setval('$if_skip_mode',run).
'$elif'(_,top) :- !, fail. '$elif'(_,top) :- !, fail.
'$elif'(Goal,_) :- '$elif'(Goal,_) :-
nb_getval('$if_level',0), '$get_if'(0),
'$do_error'(context_error(no_if),(:- elif(Goal))). '$do_error'(context_error(no_if),(:- elif(Goal))).
% we have done an if, so just skip % we have done an if, so just skip
'$elif'(_,_) :- '$elif'(_,_) :-
@ -942,7 +947,7 @@ absolute_file_name(File,Opts,TrueFileName) :-
nb_setval('$if_skip_mode',skip). nb_setval('$if_skip_mode',skip).
% we can try the elif % we can try the elif
'$elif'(Goal,_) :- '$elif'(Goal,_) :-
nb_getval('$if_level',Level), '$get_if'(Level),
nb_getval('$endif',elif(Level,OldEndif,Mode)), nb_getval('$endif',elif(Level,OldEndif,Mode)),
('$if_call'(Goal) ('$if_call'(Goal)
-> ->
@ -958,11 +963,11 @@ absolute_file_name(File,Opts,TrueFileName) :-
'$endif'(top) :- !, fail. '$endif'(top) :- !, fail.
'$endif'(_) :- '$endif'(_) :-
% unmmatched endif. % unmmatched endif.
nb_getval('$if_level',0), '$get_if'(0),
'$do_error'(context_error(no_if),(:- endif)). '$do_error'(context_error(no_if),(:- endif)).
'$endif'(_) :- '$endif'(_) :-
% back to where you belong. % back to where you belong.
nb_getval('$if_level',Level), '$get_if'(Level),
nb_getval('$endif',Endif), nb_getval('$endif',Endif),
Level0 is Level-1, Level0 is Level-1,
nb_setval('$if_level',Level0), nb_setval('$if_level',Level0),

View File

@ -743,19 +743,19 @@ yap_flag(user_input,OUT) :-
var(OUT), !, var(OUT), !,
stream_property(OUT,alias(user_input)). stream_property(OUT,alias(user_input)).
yap_flag(user_input,Stream) :- yap_flag(user_input,Stream) :-
set_stream(Stream, alias(user_input). set_stream(Stream, alias(user_input)).
yap_flag(user_output,OUT) :- yap_flag(user_output,OUT) :-
var(OUT), !, var(OUT), !,
stream_property(OUT,alias(user_output)). stream_property(OUT,alias(user_output)).
yap_flag(user_output,Stream) :- yap_flag(user_output,Stream) :-
set_stream(Stream, alias(user_output). set_stream(Stream, alias(user_output)).
yap_flag(user_error,OUT) :- yap_flag(user_error,OUT) :-
var(OUT), !, var(OUT), !,
stream_property(OUT,alias(user_error)). stream_property(OUT,alias(user_error)).
yap_flag(user_error,Stream) :- yap_flag(user_error,Stream) :-
set_stream(Stream, alias(user_error). set_stream(Stream, alias(user_error)).
yap_flag(debugger_print_options,OUT) :- yap_flag(debugger_print_options,OUT) :-
var(OUT), var(OUT),