This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
9a8f6ac4b30c1b1bba51daec1574983d20f243be
[perl5.git] / dist / Devel-PPPort / parts / inc / threads
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__
15 aTHXR
16 aTHXR_
17 dTHXR
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
50 IV
51 no_THX_arg(sv)
52         SV *sv
53         CODE:
54                 RETVAL = 1 + sv_2iv(sv);
55         OUTPUT:
56                 RETVAL
57
58 void
59 with_THX_arg(error)
60         SV *error
61         PPCODE:
62                 croak_sv(error);
63
64 =tests plan => 2
65
66 ok(&Devel::PPPort::no_THX_arg("42"), 43);
67 eval { &Devel::PPPort::with_THX_arg("yes\n"); };
68 ok($@ =~ /^yes/);