]> jfr.im git - irc/SurrealServices/srsv.git/commitdiff
Attempt to work around old versions of perl/Math::BigInt that don't like
authortabris <redacted>
Thu, 8 Sep 2011 05:55:59 +0000 (05:55 +0000)
committertabris <redacted>
Thu, 8 Sep 2011 05:55:59 +0000 (05:55 +0000)
use Math::BigInt try => 'GMP';

git-svn-id: http://svn.tabris.net/repos/srsv@3567 70d4eda1-72e9-0310-a436-91e5bd24443c

branches/0.4.3/SrSv/IPv6.pm
branches/0.4.3/SrSv/Unreal/Base64.pm

index 90f41ecc4160c5672040a933a595160c12297ae2..741c42380d96fcf3edc7129ec3297b8ab42ff9d0 100644 (file)
@@ -10,8 +10,15 @@ BEGIN {
                require Socket; import Socket;
                require Socket6; import Socket6;
                if(!HAS_64BIT_INT) {
-                       require Math::BigInt;
-                       import Math::BigInt try => 'GMP';
+                       eval {
+                               require Math::BigInt;
+                               import Math::BigInt try => 'GMP';
+                       };
+                       if($@) {
+                               print STDERR "Running old version of perl/Math::BigInt.\n", $@, "Trying again.\n";
+                               require Math::BigInt;
+                               import Math::BigInt;
+                       }
                }
                push @EXPORT, qw( AF_INET6 );
        }
index 79410787eacf66fdb337e6553aeaec2b60089a58..871cea3d2f30ef060e855b27893a4f275dd1e613 100644 (file)
@@ -26,8 +26,15 @@ use strict;
 use SrSv::64bit;
 BEGIN {
        if(!HAS_64BIT_INT) {
-               require Math::BigInt;
-               import Math::BigInt try => 'GMP';
+               eval {
+                       require Math::BigInt;
+                       import Math::BigInt try => 'GMP';
+               };
+               if($@) {
+                       print STDERR "Running old version of perl/Math::BigInt.\n", $@, "Trying again.\n";
+                       require Math::BigInt;
+                       import Math::BigInt;
+               }
        }
 }