=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/parse/asir_lib.c,v retrieving revision 1.4 retrieving revision 1.11 diff -u -p -r1.4 -r1.11 --- OpenXM_contrib2/asir2000/parse/asir_lib.c 2000/11/14 08:38:40 1.4 +++ OpenXM_contrib2/asir2000/parse/asir_lib.c 2015/08/14 13:51:56 1.11 @@ -45,7 +45,7 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/parse/asir_lib.c,v 1.3 2000/08/22 05:04:25 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/parse/asir_lib.c,v 1.10 2015/08/06 10:01:53 fujimoto Exp $ */ #include "ca.h" #include "parse.h" @@ -53,10 +53,11 @@ #include #endif -#if PARI -#include "genpari.h" - +#if defined(PARI) +# include "genpari.h" +# if !(PARI_VERSION_CODE > 131588 ) extern jmp_buf environnement; +# endif #endif extern jmp_buf env; @@ -68,20 +69,19 @@ int Call_Asir(char *,pointer *); void Init_Asir(int argc,char **argv) { - int tmp; FILE *ifp; char ifname[BUFSIZ]; extern int GC_dont_gc; - extern int read_exec_file; extern int do_asirrc; char *getenv(); static asirlib_initialized=0; if ( asirlib_initialized ) return; + GC_init(); asirlib_initialized = 1; do_file = 1; -#if PARI +#if defined(PARI) risa_pari_init(); #endif srandom((int)get_current_time()); @@ -93,10 +93,9 @@ void Init_Asir(int argc,char **argv) rtime_init(); env_init(); endian_init(); -#if !defined(VISUAL) && !defined(THINK_C) +#if !defined(VISUAL) && !defined(__MINGW32__) && !defined(THINK_C) /* check_key(); */ #endif - GC_init(); process_args(--argc,++argv); copyright(); output_init(); @@ -119,11 +118,8 @@ void Init_Asir(int argc,char **argv) #endif if ( do_asirrc && (ifp = fopen(ifname,"r")) ) { input_init(ifp,ifname); - if ( !setjmp(env) ) { - read_exec_file = 1; + if ( !setjmp(asir_infile->jmpbuf) ) read_eval_loop(); - read_exec_file = 0; - } fclose(ifp); } else error(".asirrc not found"); @@ -134,12 +130,16 @@ int Call_Asir(char *cmd,pointer *result) { SNODE snode; pointer val; -#if PARI +#if defined(PARI) + void recover(int); + recover(0); +# if !(PARI_VERSION_CODE > 131588) if ( setjmp(environnement) ) { avma = top; recover(1); error("PARI error"); } +# endif #endif if ( setjmp(env) ) { *result = 0;