Rename exception() to apitest_exception() in XS/APItest, so that it
authorNicholas Clark <nick@ccl4.org>
Sun, 4 Mar 2007 11:51:08 +0000 (11:51 +0000)
committerNicholas Clark <nick@ccl4.org>
Sun, 4 Mar 2007 11:51:08 +0000 (11:51 +0000)
doesn't clash with the exception() in Devel/PPPort. This way, all
tests pass when both modules are staticly linked.

p4raw-id: //depot/perl@30459

ext/XS/APItest/APItest.pm
ext/XS/APItest/APItest.xs
ext/XS/APItest/exception.c
ext/XS/APItest/t/exception.t

index e230eb2..17e6abb 100644 (file)
@@ -19,7 +19,7 @@ our @EXPORT = qw( print_double print_int print_long
                  call_sv call_pv call_method eval_sv eval_pv require_pv
                  G_SCALAR G_ARRAY G_VOID G_DISCARD G_EVAL G_NOARGS
                  G_KEEPERR G_NODEBUG G_METHOD
-                 exception mycroak strtab
+                 apitest_exception mycroak strtab
                  my_cxt_getint my_cxt_getsv my_cxt_setint my_cxt_setsv
                  sv_setsv_cow_hashkey_core sv_setsv_cow_hashkey_notcore
 );
index 9d56365..b01ae55 100644 (file)
@@ -49,7 +49,7 @@ my_cxt_setsv_p(SV* sv _pMY_CXT)
 
 
 /* from exception.c */
-int exception(int);
+int apitest_exception(int);
 
 /* from core_or_not.inc */
 bool sv_setsv_cow_hashkey_core(void);
@@ -507,7 +507,7 @@ require_pv(pv)
        require_pv(pv);
 
 int
-exception(throw_e)
+apitest_exception(throw_e)
     int throw_e
     OUTPUT:
         RETVAL
index 9477ea9..01ff912 100644 (file)
@@ -10,7 +10,11 @@ static void throws_exception(int throw_e)
     croak("boo\n");
 }
 
-int exception(int throw_e)
+/* Don't give this the same name as exection() in ext/Devel/PPPort/module3.c
+   as otherwise building entirely staticly will cause a test to fail, as
+   PPPort's execption() gets used in place of this one.  */
+   
+int apitest_exception(int throw_e)
 {
   dTHR;
   dXCPT;
index dc6d324..2ac7132 100644 (file)
@@ -19,7 +19,7 @@ my $rv;
 
 $XS::APItest::exception_caught = undef;
 
-$rv = eval { exception(0) };
+$rv = eval { apitest_exception(0) };
 is($@, '');
 ok(defined $rv);
 is($rv, 42);
@@ -27,7 +27,7 @@ is($XS::APItest::exception_caught, 0);
 
 $XS::APItest::exception_caught = undef;
 
-$rv = eval { exception(1) };
+$rv = eval { apitest_exception(1) };
 is($@, "boo\n");
 ok(not defined $rv);
 is($XS::APItest::exception_caught, 1);