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