pike.git / src / bignum.c

version» Context lines:

pike.git/src/bignum.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: bignum.c,v 1.29 2003/01/13 14:42:06 grubba Exp $ + || $Id: bignum.c,v 1.30 2003/01/27 08:16:53 mirar Exp $   */      #include "global.h"      #ifdef AUTO_BIGNUM      #include "interpret.h"   #include "program.h"   #include "object.h"   #include "svalue.h"
pike.git/src/bignum.c:40:   {    free_svalue(&auto_bignum_program);    auto_bignum_program.type=T_INT;   }      PMOD_EXPORT void convert_stack_top_to_bignum(void)   {    apply_svalue(&auto_bignum_program, 1);       if(sp[-1].type != T_OBJECT) -  Pike_error("Gmp.mpz conversion failed.\n"); +  { +  if (auto_bignum_program.type!=T_PROGRAM) +  { +  /* for some reason, Gmp isn't loaded */ +  push_text("Gmp"); +  push_int(0); +  SAFE_APPLY_MASTER("resolv",2); +  pop_stack(); +  +  if (auto_bignum_program.type!=T_PROGRAM) +  Pike_error("Gmp.mpz conversion failed (failed to load Gmp?).\n"); +  +  apply_svalue(&auto_bignum_program, 1);    }    -  +  if(sp[-1].type != T_OBJECT) +  Pike_error("Gmp.mpz conversion failed (unknown error).\n"); +  } + } +    PMOD_EXPORT void convert_stack_top_with_base_to_bignum(void)   {    apply_svalue(&auto_bignum_program, 2);       if(sp[-1].type != T_OBJECT)    Pike_error("Gmp.mpz conversion failed.\n");   }      int is_bignum_object(struct object *o)   {