This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
parts/inc/threads: Add hints
[perl5.git] / dist / Devel-PPPort / parts / inc / threads
CommitLineData
adfe19db
MHM
1################################################################################
2##
b2049988 3## Version 3.x, Copyright (C) 2004-2013, Marcus Holland-Moritz.
adfe19db
MHM
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__
cac25305
MHM
15aTHXR
16aTHXR_
17dTHXR
adfe19db
MHM
18
19=implementation
20
21__UNDEFINED__ dTHR dNOOP
22
23__UNDEFINED__ dTHX dNOOP
758bcf0b
KW
24/* Hint: dTHX
25
26 For pre-5.6.0 thread compatibility, instead use dTHXR, available only through
27 ppport.h */
28
adfe19db
MHM
29__UNDEFINED__ dTHXa(x) dNOOP
30
31__UNDEFINED__ pTHX void
32__UNDEFINED__ pTHX_
33__UNDEFINED__ aTHX
758bcf0b
KW
34/* Hint: aTHX
35
36 For pre-5.6.0 thread compatibility, instead use aTHXR, available only through
37 ppport.h */
38
adfe19db 39__UNDEFINED__ aTHX_
758bcf0b
KW
40/* Hint: aTHX_
41
42 For pre-5.6.0 thread compatibility, instead use aTHXR_, available only
43 through ppport.h */
adfe19db 44
cac25305
MHM
45#if { VERSION < 5.6.0 }
46# ifdef USE_THREADS
47# define aTHXR thr
c83e6f19 48# define aTHXR_ thr,
cac25305
MHM
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
adfe19db
MHM
60__UNDEFINED__ dTHXoa(x) dTHXa(x)
61
62=xsubs
63
64IV
65no_THX_arg(sv)
b2049988
MHM
66 SV *sv
67 CODE:
68 RETVAL = 1 + sv_2iv(sv);
69 OUTPUT:
70 RETVAL
adfe19db
MHM
71
72void
73with_THX_arg(error)
051475ba 74 SV *error
b2049988 75 PPCODE:
051475ba 76 croak_sv(error);
adfe19db
MHM
77
78=tests plan => 2
79
80ok(&Devel::PPPort::no_THX_arg("42"), 43);
81eval { &Devel::PPPort::with_THX_arg("yes\n"); };
82ok($@ =~ /^yes/);