Merge tag 'upstream/3.3.3'
[debian/amanda] / perl / amglue / bigint.c
index 75bc1a562140e7b6a81459bab4e0720bf5e27af9..06e37253d81dca1938f791d39395ee97d42f4f33 100644 (file)
@@ -1,24 +1,26 @@
 /*
- * Copyright (c) 2005 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2007-2012 Zmanda, Inc.  All Rights Reserved.
  *
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License version 2.1 as
- * published by the Free Software Foundation.
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
  *
- * This library is distributed in the hope that it will be useful, but
+ * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
- * License for more details.
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * for more details.
  *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  *
- * Contact information: Zmanda Inc., 505 N Mathlida Ave, Suite 120
+ * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
  */
 
 #include "amglue.h"
+#include "stdint.h"
 
 /*
  * C -> Perl
@@ -34,7 +36,7 @@ load_Math_BigInt(void)
 
     if (loaded) return;
 
-    eval_pv("use Math::BigInt;", 1);
+    eval_pv("use Math::BigInt; use Amanda::BigIntCompat;", 1);
     loaded = 1;
 }
 
@@ -50,17 +52,19 @@ str2bigint(char *num)
     SV *rv;
     dSP;
 
-    load_Math_BigInt();
-
     ENTER;
     SAVETMPS;
 
+    load_Math_BigInt();
+    SPAGAIN;
+
+    EXTEND(SP, 2);
     PUSHMARK(SP);
     XPUSHs(sv_2mortal(newSVpv("Math::BigInt", 0)));
     XPUSHs(sv_2mortal(newSVpv(num, 0)));
     PUTBACK;
 
-    count = call_method("Math::BigInt::new", G_SCALAR);
+    count = call_method("new", G_SCALAR);
 
     SPAGAIN;