Commit | Line | Data |
---|---|---|
adfe19db MHM |
1 | /******************************************************************************* |
2 | * | |
3 | * Perl/Pollution/Portability | |
4 | * | |
5 | ******************************************************************************** | |
6 | * | |
b2049988 | 7 | * Version 3.x, Copyright (C) 2004-2013, Marcus Holland-Moritz. |
adfe19db MHM |
8 | * Version 2.x, Copyright (C) 2001, Paul Marquess. |
9 | * Version 1.x, Copyright (C) 1999, Kenneth Albanowski. | |
10 | * | |
11 | * This program is free software; you can redistribute it and/or | |
12 | * modify it under the same terms as Perl itself. | |
13 | * | |
14 | *******************************************************************************/ | |
0a7c7f4f JH |
15 | |
16 | #include "EXTERN.h" | |
17 | #include "perl.h" | |
2dd69576 | 18 | |
c01be2ce | 19 | #define NEED_PL_parser |
2dd69576 | 20 | #define NO_XSLOCKS |
0a7c7f4f JH |
21 | #include "XSUB.h" |
22 | ||
23 | #include "ppport.h" | |
24 | ||
2dd69576 MHM |
25 | static void throws_exception(int throw_e) |
26 | { | |
27 | if (throw_e) | |
28 | croak("boo\n"); | |
29 | } | |
30 | ||
31 | int exception(int throw_e) | |
32 | { | |
33 | dTHR; | |
34 | dXCPT; | |
35 | SV *caught = get_sv("Devel::PPPort::exception_caught", 0); | |
36 | ||
37 | XCPT_TRY_START { | |
38 | throws_exception(throw_e); | |
39 | } XCPT_TRY_END | |
40 | ||
41 | XCPT_CATCH | |
42 | { | |
43 | sv_setiv(caught, 1); | |
44 | XCPT_RETHROW; | |
45 | } | |
46 | ||
47 | sv_setiv(caught, 0); | |
48 | ||
49 | return 42; | |
50 | } | |
51 | ||
adfe19db | 52 | void call_newCONSTSUB_3(void) |
0a7c7f4f | 53 | { |
adfe19db | 54 | newCONSTSUB(gv_stashpv("Devel::PPPort", FALSE), "test_value_3", newSViv(3)); |
0a7c7f4f | 55 | } |
2dd69576 | 56 | |
0d0f8426 MHM |
57 | U32 get_PL_signals_3(void) |
58 | { | |
59 | return PL_signals; | |
60 | } | |
c01be2ce MHM |
61 | |
62 | int dummy_parser_warning(void) | |
63 | { | |
64 | char * volatile my_bufptr; | |
65 | char * volatile *my_p_bufptr; | |
66 | my_bufptr = PL_bufptr; | |
67 | my_p_bufptr = &PL_bufptr; | |
68 | PL_bufptr = my_bufptr; | |
69 | PL_bufptr = *my_p_bufptr; | |
70 | return &PL_bufptr != NULL; | |
71 | } |