Commit | Line | Data |
adfe19db |
1 | ################################################################################ |
2 | ## |
c83e6f19 |
3 | ## $Revision: 9 $ |
adfe19db |
4 | ## $Author: mhx $ |
c83e6f19 |
5 | ## $Date: 2007/08/18 20:16:12 +0200 $ |
adfe19db |
6 | ## |
7 | ################################################################################ |
8 | ## |
d2dacc4f |
9 | ## Version 3.x, Copyright (C) 2004-2007, Marcus Holland-Moritz. |
adfe19db |
10 | ## Version 2.x, Copyright (C) 2001, Paul Marquess. |
11 | ## Version 1.x, Copyright (C) 1999, Kenneth Albanowski. |
12 | ## |
13 | ## This program is free software; you can redistribute it and/or |
14 | ## modify it under the same terms as Perl itself. |
15 | ## |
16 | ################################################################################ |
17 | |
18 | =provides |
19 | |
20 | __UNDEFINED__ |
cac25305 |
21 | aTHXR |
22 | aTHXR_ |
23 | dTHXR |
adfe19db |
24 | |
25 | =implementation |
26 | |
27 | __UNDEFINED__ dTHR dNOOP |
28 | |
29 | __UNDEFINED__ dTHX dNOOP |
30 | __UNDEFINED__ dTHXa(x) dNOOP |
31 | |
32 | __UNDEFINED__ pTHX void |
33 | __UNDEFINED__ pTHX_ |
34 | __UNDEFINED__ aTHX |
35 | __UNDEFINED__ aTHX_ |
36 | |
cac25305 |
37 | #if { VERSION < 5.6.0 } |
38 | # ifdef USE_THREADS |
39 | # define aTHXR thr |
c83e6f19 |
40 | # define aTHXR_ thr, |
cac25305 |
41 | # else |
42 | # define aTHXR |
43 | # define aTHXR_ |
44 | # endif |
45 | # define dTHXR dTHR |
46 | #else |
47 | # define aTHXR aTHX |
48 | # define aTHXR_ aTHX_ |
49 | # define dTHXR dTHX |
50 | #endif |
51 | |
adfe19db |
52 | __UNDEFINED__ dTHXoa(x) dTHXa(x) |
53 | |
54 | =xsubs |
55 | |
56 | IV |
57 | no_THX_arg(sv) |
58 | SV *sv |
59 | CODE: |
60 | RETVAL = 1 + sv_2iv(sv); |
61 | OUTPUT: |
62 | RETVAL |
63 | |
64 | void |
65 | with_THX_arg(error) |
66 | char *error |
67 | PPCODE: |
68 | Perl_croak(aTHX_ "%s", error); |
69 | |
70 | =tests plan => 2 |
71 | |
72 | ok(&Devel::PPPort::no_THX_arg("42"), 43); |
73 | eval { &Devel::PPPort::with_THX_arg("yes\n"); }; |
74 | ok($@ =~ /^yes/); |
75 | |