From 7a646707d4c96d60a8c48febd5483da865fc777a Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sun, 4 Mar 2007 11:51:08 +0000 Subject: [PATCH] Rename exception() to apitest_exception() in XS/APItest, so that it 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 | 2 +- ext/XS/APItest/APItest.xs | 4 ++-- ext/XS/APItest/exception.c | 6 +++++- ext/XS/APItest/t/exception.t | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ext/XS/APItest/APItest.pm b/ext/XS/APItest/APItest.pm index e230eb2..17e6abb 100644 --- a/ext/XS/APItest/APItest.pm +++ b/ext/XS/APItest/APItest.pm @@ -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 ); diff --git a/ext/XS/APItest/APItest.xs b/ext/XS/APItest/APItest.xs index 9d56365..b01ae55 100644 --- a/ext/XS/APItest/APItest.xs +++ b/ext/XS/APItest/APItest.xs @@ -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 diff --git a/ext/XS/APItest/exception.c b/ext/XS/APItest/exception.c index 9477ea9..01ff912 100644 --- a/ext/XS/APItest/exception.c +++ b/ext/XS/APItest/exception.c @@ -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; diff --git a/ext/XS/APItest/t/exception.t b/ext/XS/APItest/t/exception.t index dc6d324..2ac7132 100644 --- a/ext/XS/APItest/t/exception.t +++ b/ext/XS/APItest/t/exception.t @@ -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); -- 2.7.4