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/* Hint: dTHX
25
26  For pre-5.6.0 thread compatibility, instead use dTHXR, available only through
27  ppport.h */
28
29__UNDEFINED__  dTHXa(x)   dNOOP
30
31__UNDEFINED__  pTHX       void
32__UNDEFINED__  pTHX_
33__UNDEFINED__  aTHX
34/* Hint: aTHX
35
36  For pre-5.6.0 thread compatibility, instead use aTHXR, available only through
37  ppport.h */
38
39__UNDEFINED__  aTHX_
40/* Hint: aTHX_
41
42  For pre-5.6.0 thread compatibility, instead use aTHXR_, available only
43  through ppport.h */
44
45#if { VERSION < 5.6.0 }
46#  ifdef USE_THREADS
47#    define aTHXR  thr
48#    define aTHXR_ thr,
49#  else
50#    define aTHXR
51#    define aTHXR_
52#  endif
53#  define dTHXR  dTHR
54#else
55#  define aTHXR  aTHX
56#  define aTHXR_ aTHX_
57#  define dTHXR  dTHX
58#endif
59
60__UNDEFINED__  dTHXoa(x)  dTHXa(x)
61
62=xsubs
63
64IV
65no_THX_arg(sv)
66        SV *sv
67        CODE:
68                RETVAL = 1 + sv_2iv(sv);
69        OUTPUT:
70                RETVAL
71
72void
73with_THX_arg(error)
74        SV *error
75        PPCODE:
76                croak_sv(error);
77
78=tests plan => 2
79
80is(&Devel::PPPort::no_THX_arg("42"), 43);
81eval { &Devel::PPPort::with_THX_arg("yes\n"); };
82ok($@ =~ /^yes/);
83