Stop "Possible use before definition" warning following change 24997
[p5sagit/p5-mst-13.2.git] / ext / XS / APItest / exception.c
CommitLineData
9b5c3821 1#include "EXTERN.h"
2#include "perl.h"
3
4#define NO_XSLOCKS
5#include "XSUB.h"
6
7static void throws_exception(int throw_e)
8{
9 if (throw_e)
10 croak("boo\n");
11}
12
13int exception(int throw_e)
14{
15 dTHR;
16 dXCPT;
17 SV *caught = get_sv("XS::APItest::exception_caught", 0);
18
19 XCPT_TRY_START {
20 throws_exception(throw_e);
21 } XCPT_TRY_END
22
23 XCPT_CATCH
24 {
25 sv_setiv(caught, 1);
26 XCPT_RETHROW;
27 }
28
29 sv_setiv(caught, 0);
30
31 return 42;
32}
33