# HG changeset patch # User samer # Date 1329932046 0 # Node ID 8300e1fb8952193dcb0ed3038f7c87d183f34601 # Parent 71aa901aa435e5aab384c0132a71810a9421eaa7 Added implementation of alarm_at/3 for older versions of SWI that don't have it. diff -r 71aa901aa435 -r 8300e1fb8952 qutils.pl --- a/qutils.pl Wed Feb 15 15:04:23 2012 +0000 +++ b/qutils.pl Wed Feb 22 17:34:06 2012 +0000 @@ -18,8 +18,16 @@ % NB: may fail if Msg is bound on input. get_message_or_timeout(inf,Msg) :- !, thread_get_message(Msg). +% Older versions of SWI do not have alarm_at/3 +:- if(\+current_predicate(alarm_at/3)). +:- writeln('% compiling alarm_at/3.'). +alarm_at(A,B,C) :- alarm_at(A,B,C,[]). +:- endif. + +% Older versions of SWI do not have thread_get_message/3 :- if(current_predicate(thread_get_message/3)). +% we have thread_get_message/3 but we may or may not have the deadline/1 option :- if(current_predicate_option(thread_get_message/3,3,deadline(_))). :- writeln('% compiling get_message_or_timeout/2 using deadline/1 option.').