This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Perl_my_vsnprintf: avoid compiler warning
[perl5.git] / cpan / Devel-PPPort / parts / inc / misc
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__
15PERL_UNUSED_DECL
f2ab5a41
MHM
16PERL_UNUSED_ARG
17PERL_UNUSED_VAR
18PERL_UNUSED_CONTEXT
a745474a 19PERL_GCC_BRACE_GROUPS_FORBIDDEN
c07deaaf 20PERL_USE_GCC_BRACE_GROUPS
9c0a17a0
MHM
21PERLIO_FUNCS_DECL
22PERLIO_FUNCS_CAST
adfe19db
MHM
23NVTYPE
24INT2PTR
25PTRV
26NUM2PTR
c83e6f19 27PERL_HASH
adfe19db
MHM
28PTR2IV
29PTR2UV
30PTR2NV
31PTR2ul
a745474a
MHM
32START_EXTERN_C
33END_EXTERN_C
34EXTERN_C
35STMT_START
36STMT_END
679ad62d 37UTF8_MAXBYTES
b2049988 38WIDEST_UTYPE
0d0f8426 39XSRETURN
ea4b7f32 40HeUTF8
adfe19db
MHM
41
42=implementation
43
62093c1c
NC
44#ifndef PERL_UNUSED_DECL
45# ifdef HASATTRIBUTE
46# if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
47# define PERL_UNUSED_DECL
48# else
49# define PERL_UNUSED_DECL __attribute__((unused))
50# endif
adfe19db 51# else
62093c1c 52# define PERL_UNUSED_DECL
adfe19db 53# endif
adfe19db
MHM
54#endif
55
f2ab5a41
MHM
56#ifndef PERL_UNUSED_ARG
57# if defined(lint) && defined(S_SPLINT_S) /* www.splint.org */
58# include <note.h>
59# define PERL_UNUSED_ARG(x) NOTE(ARGUNUSED(x))
60# else
61# define PERL_UNUSED_ARG(x) ((void)x)
62# endif
63#endif
64
65#ifndef PERL_UNUSED_VAR
66# define PERL_UNUSED_VAR(x) ((void)x)
67#endif
68
69#ifndef PERL_UNUSED_CONTEXT
70# ifdef USE_ITHREADS
71# define PERL_UNUSED_CONTEXT PERL_UNUSED_ARG(my_perl)
72# else
73# define PERL_UNUSED_CONTEXT
74# endif
75#endif
76
77__UNDEFINED__ NOOP /*EMPTY*/(void)0
78__UNDEFINED__ dNOOP extern int /*@unused@*/ Perl___notused PERL_UNUSED_DECL
adfe19db
MHM
79
80#ifndef NVTYPE
81# if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
82# define NVTYPE long double
83# else
84# define NVTYPE double
85# endif
86typedef NVTYPE NV;
87#endif
88
89#ifndef INT2PTR
adfe19db
MHM
90# if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
91# define PTRV UV
92# define INT2PTR(any,d) (any)(d)
93# else
94# if PTRSIZE == LONGSIZE
95# define PTRV unsigned long
96# else
97# define PTRV unsigned
98# endif
99# define INT2PTR(any,d) (any)(PTRV)(d)
100# endif
7bb03b24 101#endif
adfe19db 102
7bb03b24 103#ifndef PTR2ul
adfe19db
MHM
104# if PTRSIZE == LONGSIZE
105# define PTR2ul(p) (unsigned long)(p)
106# else
4a582685 107# define PTR2ul(p) INT2PTR(unsigned long,p)
adfe19db 108# endif
7bb03b24 109#endif
adfe19db 110
7bb03b24
MHM
111__UNDEFINED__ PTR2nat(p) (PTRV)(p)
112__UNDEFINED__ NUM2PTR(any,d) (any)PTR2nat(d)
113__UNDEFINED__ PTR2IV(p) INT2PTR(IV,p)
114__UNDEFINED__ PTR2UV(p) INT2PTR(UV,p)
115__UNDEFINED__ PTR2NV(p) NUM2PTR(NV,p)
adfe19db 116
a745474a
MHM
117#undef START_EXTERN_C
118#undef END_EXTERN_C
119#undef EXTERN_C
120#ifdef __cplusplus
121# define START_EXTERN_C extern "C" {
122# define END_EXTERN_C }
123# define EXTERN_C extern "C"
124#else
125# define START_EXTERN_C
126# define END_EXTERN_C
127# define EXTERN_C extern
128#endif
129
c07deaaf
MHM
130#if defined(PERL_GCC_PEDANTIC)
131# ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN
a745474a
MHM
132# define PERL_GCC_BRACE_GROUPS_FORBIDDEN
133# endif
134#endif
135
c07deaaf
MHM
136#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus)
137# ifndef PERL_USE_GCC_BRACE_GROUPS
138# define PERL_USE_GCC_BRACE_GROUPS
139# endif
140#endif
141
a745474a
MHM
142#undef STMT_START
143#undef STMT_END
c07deaaf 144#ifdef PERL_USE_GCC_BRACE_GROUPS
b2049988
MHM
145# define STMT_START (void)( /* gcc supports ``({ STATEMENTS; })'' */
146# define STMT_END )
a745474a
MHM
147#else
148# if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__)
b2049988
MHM
149# define STMT_START if (1)
150# define STMT_END else (void)0
a745474a 151# else
b2049988
MHM
152# define STMT_START do
153# define STMT_END while (0)
a745474a
MHM
154# endif
155#endif
156
adfe19db
MHM
157__UNDEFINED__ boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no)
158
159/* DEFSV appears first in 5.004_56 */
b2049988 160__UNDEFINED__ DEFSV GvSV(PL_defgv)
adfe19db 161__UNDEFINED__ SAVE_DEFSV SAVESPTR(GvSV(PL_defgv))
ac2e3cea 162__UNDEFINED__ DEFSV_set(sv) (DEFSV = (sv))
adfe19db
MHM
163
164/* Older perls (<=5.003) lack AvFILLp */
165__UNDEFINED__ AvFILLp AvFILL
166
167__UNDEFINED__ ERRSV get_sv("@",FALSE)
168
adfe19db
MHM
169/* Hint: gv_stashpvn
170 * This function's backport doesn't support the length parameter, but
171 * rather ignores it. Portability can only be ensured if the length
172 * parameter is used for speed reasons, but the length can always be
173 * correctly computed from the string argument.
174 */
175
176__UNDEFINED__ gv_stashpvn(str,len,create) gv_stashpv(str,create)
177
178/* Replace: 1 */
179__UNDEFINED__ get_cv perl_get_cv
180__UNDEFINED__ get_sv perl_get_sv
181__UNDEFINED__ get_av perl_get_av
182__UNDEFINED__ get_hv perl_get_hv
183/* Replace: 0 */
184
adfe19db
MHM
185__UNDEFINED__ dUNDERBAR dNOOP
186__UNDEFINED__ UNDERBAR DEFSV
187
188__UNDEFINED__ dAX I32 ax = MARK - PL_stack_base + 1
189__UNDEFINED__ dITEMS I32 items = SP - MARK
190
9132e1a3
MHM
191__UNDEFINED__ dXSTARG SV * targ = sv_newmortal()
192
0d0f8426
MHM
193__UNDEFINED__ dAXMARK I32 ax = POPMARK; \
194 register SV ** const mark = PL_stack_base + ax++
195
196
197__UNDEFINED__ XSprePUSH (sp = PL_stack_base + ax - 1)
198
199#if { VERSION < 5.005 }
200# undef XSRETURN
201# define XSRETURN(off) \
202 STMT_START { \
203 PL_stack_sp = PL_stack_base + ax + ((off) - 1); \
204 return; \
205 } STMT_END
206#endif
207
8565c31a
MHM
208__UNDEFINED__ XSPROTO(name) void name(pTHX_ CV* cv)
209__UNDEFINED__ SVfARG(p) ((void*)(p))
210
f2ab5a41
MHM
211__UNDEFINED__ PERL_ABS(x) ((x) < 0 ? -(x) : (x))
212
213__UNDEFINED__ dVAR dNOOP
214
215__UNDEFINED__ SVf "_"
216
c83e6f19
MHM
217__UNDEFINED__ UTF8_MAXBYTES UTF8_MAXLEN
218
fd7af155
MHM
219__UNDEFINED__ CPERLscope(x) x
220
c83e6f19 221__UNDEFINED__ PERL_HASH(hash,str,len) \
b2049988
MHM
222 STMT_START { \
223 const char *s_PeRlHaSh = str; \
224 I32 i_PeRlHaSh = len; \
225 U32 hash_PeRlHaSh = 0; \
226 while (i_PeRlHaSh--) \
227 hash_PeRlHaSh = hash_PeRlHaSh * 33 + *s_PeRlHaSh++; \
228 (hash) = hash_PeRlHaSh; \
c83e6f19 229 } STMT_END
679ad62d 230
9c0a17a0
MHM
231#ifndef PERLIO_FUNCS_DECL
232# ifdef PERLIO_FUNCS_CONST
233# define PERLIO_FUNCS_DECL(funcs) const PerlIO_funcs funcs
234# define PERLIO_FUNCS_CAST(funcs) (PerlIO_funcs*)(funcs)
235# else
236# define PERLIO_FUNCS_DECL(funcs) PerlIO_funcs funcs
237# define PERLIO_FUNCS_CAST(funcs) (funcs)
238# endif
239#endif
240
fd7af155
MHM
241/* provide these typedefs for older perls */
242#if { VERSION < 5.9.3 }
243
244# ifdef ARGSproto
245typedef OP* (CPERLscope(*Perl_ppaddr_t))(ARGSproto);
246# else
247typedef OP* (CPERLscope(*Perl_ppaddr_t))(pTHX);
248# endif
249
250typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*);
251
252#endif
253
b2049988
MHM
254__UNDEFINED__ isPSXSPC(c) (isSPACE(c) || (c) == '\v')
255__UNDEFINED__ isBLANK(c) ((c) == ' ' || (c) == '\t')
db42c902 256#ifdef EBCDIC
b2049988
MHM
257__UNDEFINED__ isALNUMC(c) isalnum(c)
258__UNDEFINED__ isASCII(c) isascii(c)
259__UNDEFINED__ isCNTRL(c) iscntrl(c)
260__UNDEFINED__ isGRAPH(c) isgraph(c)
261__UNDEFINED__ isPRINT(c) isprint(c)
262__UNDEFINED__ isPUNCT(c) ispunct(c)
263__UNDEFINED__ isXDIGIT(c) isxdigit(c)
db42c902
MHM
264#else
265# if { VERSION < 5.10.0 }
266/* Hint: isPRINT
267 * The implementation in older perl versions includes all of the
268 * isSPACE() characters, which is wrong. The version provided by
269 * Devel::PPPort always overrides a present buggy version.
270 */
271# undef isPRINT
272# endif
b2049988
MHM
273
274#ifdef HAS_QUAD
744ef08f
CBW
275# ifdef U64TYPE
276# define WIDEST_UTYPE U64TYPE
277# else
278# define WIDEST_UTYPE Quad_t
279# endif
b2049988
MHM
280#else
281# define WIDEST_UTYPE U32
282#endif
283
284__UNDEFINED__ isALNUMC(c) (isALPHA(c) || isDIGIT(c))
285__UNDEFINED__ isASCII(c) ((WIDEST_UTYPE) (c) <= 127)
286__UNDEFINED__ isCNTRL(c) ((WIDEST_UTYPE) (c) < ' ' || (c) == 127)
287__UNDEFINED__ isGRAPH(c) (isALNUM(c) || isPUNCT(c))
288__UNDEFINED__ isPRINT(c) (((c) >= 32 && (c) < 127))
289__UNDEFINED__ isPUNCT(c) (((c) >= 33 && (c) <= 47) || ((c) >= 58 && (c) <= 64) || ((c) >= 91 && (c) <= 96) || ((c) >= 123 && (c) <= 126))
290__UNDEFINED__ isXDIGIT(c) (isDIGIT(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
db42c902
MHM
291#endif
292
ea4b7f32
JH
293/* Until we figure out how to support this in older perls... */
294#if { VERSION >= 5.8.0 }
295
296__UNDEFINED__ HeUTF8(he) ((HeKLEN(he) == HEf_SVKEY) ? \
297 SvUTF8(HeKEY_sv(he)) : \
298 (U32)HeKUTF8(he))
299
300#endif
301
9132e1a3
MHM
302=xsmisc
303
8565c31a
MHM
304typedef XSPROTO(XSPROTO_test_t);
305typedef XSPROTO_test_t *XSPROTO_test_t_ptr;
306
9132e1a3
MHM
307XS(XS_Devel__PPPort_dXSTARG); /* prototype */
308XS(XS_Devel__PPPort_dXSTARG)
309{
310 dXSARGS;
311 dXSTARG;
2dd69576 312 IV iv;
e7368224
MH
313
314 PERL_UNUSED_VAR(cv);
9132e1a3 315 SP -= items;
2dd69576 316 iv = SvIV(ST(0)) + 1;
9132e1a3
MHM
317 PUSHi(iv);
318 XSRETURN(1);
319}
320
0d0f8426
MHM
321XS(XS_Devel__PPPort_dAXMARK); /* prototype */
322XS(XS_Devel__PPPort_dAXMARK)
323{
324 dSP;
325 dAXMARK;
326 dITEMS;
327 IV iv;
e7368224
MH
328
329 PERL_UNUSED_VAR(cv);
0d0f8426
MHM
330 SP -= items;
331 iv = SvIV(ST(0)) - 1;
c1a049cb 332 mPUSHi(iv);
0d0f8426
MHM
333 XSRETURN(1);
334}
335
9132e1a3
MHM
336=xsboot
337
8565c31a
MHM
338{
339 XSPROTO_test_t_ptr p = &XS_Devel__PPPort_dXSTARG;
340 newXS("Devel::PPPort::dXSTARG", *p, file);
341}
0d0f8426 342newXS("Devel::PPPort::dAXMARK", XS_Devel__PPPort_dAXMARK, file);
9132e1a3 343
adfe19db
MHM
344=xsubs
345
346int
7bb03b24 347ptrtests()
b2049988
MHM
348 PREINIT:
349 int var, *p = &var;
7bb03b24 350
b2049988
MHM
351 CODE:
352 RETVAL = 0;
353 RETVAL += PTR2nat(p) != 0 ? 1 : 0;
354 RETVAL += PTR2ul(p) != 0UL ? 2 : 0;
355 RETVAL += PTR2UV(p) != (UV) 0 ? 4 : 0;
356 RETVAL += PTR2IV(p) != (IV) 0 ? 8 : 0;
357 RETVAL += PTR2NV(p) != (NV) 0 ? 16 : 0;
358 RETVAL += p > NUM2PTR(int *, 0) ? 32 : 0;
7bb03b24 359
b2049988
MHM
360 OUTPUT:
361 RETVAL
7bb03b24
MHM
362
363int
adfe19db 364gv_stashpvn(name, create)
b2049988
MHM
365 char *name
366 I32 create
367 CODE:
368 RETVAL = gv_stashpvn(name, strlen(name), create) != NULL;
369 OUTPUT:
370 RETVAL
adfe19db
MHM
371
372int
373get_sv(name, create)
b2049988
MHM
374 char *name
375 I32 create
376 CODE:
377 RETVAL = get_sv(name, create) != NULL;
378 OUTPUT:
379 RETVAL
adfe19db
MHM
380
381int
382get_av(name, create)
b2049988
MHM
383 char *name
384 I32 create
385 CODE:
386 RETVAL = get_av(name, create) != NULL;
387 OUTPUT:
388 RETVAL
adfe19db
MHM
389
390int
391get_hv(name, create)
b2049988
MHM
392 char *name
393 I32 create
394 CODE:
395 RETVAL = get_hv(name, create) != NULL;
396 OUTPUT:
397 RETVAL
adfe19db
MHM
398
399int
400get_cv(name, create)
b2049988
MHM
401 char *name
402 I32 create
403 CODE:
404 RETVAL = get_cv(name, create) != NULL;
405 OUTPUT:
406 RETVAL
adfe19db
MHM
407
408void
0d0f8426 409xsreturn(two)
b2049988
MHM
410 int two
411 PPCODE:
412 mXPUSHp("test1", 5);
413 if (two)
414 mXPUSHp("test2", 5);
415 if (two)
416 XSRETURN(2);
417 else
418 XSRETURN(1);
0d0f8426 419
adfe19db
MHM
420SV*
421boolSV(value)
b2049988
MHM
422 int value
423 CODE:
424 RETVAL = newSVsv(boolSV(value));
425 OUTPUT:
426 RETVAL
adfe19db
MHM
427
428SV*
429DEFSV()
b2049988
MHM
430 CODE:
431 RETVAL = newSVsv(DEFSV);
432 OUTPUT:
433 RETVAL
adfe19db 434
51d6c659
MHM
435void
436DEFSV_modify()
b2049988
MHM
437 PPCODE:
438 XPUSHs(sv_mortalcopy(DEFSV));
439 ENTER;
440 SAVE_DEFSV;
441 DEFSV_set(newSVpvs("DEFSV"));
442 XPUSHs(sv_mortalcopy(DEFSV));
443 /* Yes, this leaks the above scalar; 5.005 with threads for some reason */
444 /* frees it upon LEAVE, thus mortalizing it causes "attempt to free..." */
445 /* sv_2mortal(DEFSV); */
446 LEAVE;
447 XPUSHs(sv_mortalcopy(DEFSV));
448 XSRETURN(3);
51d6c659 449
adfe19db
MHM
450int
451ERRSV()
b2049988
MHM
452 CODE:
453 RETVAL = SvTRUE(ERRSV);
454 OUTPUT:
455 RETVAL
adfe19db
MHM
456
457SV*
458UNDERBAR()
b2049988
MHM
459 CODE:
460 {
461 dUNDERBAR;
462 RETVAL = newSVsv(UNDERBAR);
463 }
464 OUTPUT:
465 RETVAL
adfe19db 466
0d0f8426
MHM
467void
468prepush()
b2049988
MHM
469 CODE:
470 {
471 dXSTARG;
472 XSprePUSH;
473 PUSHi(42);
474 XSRETURN(1);
475 }
0d0f8426 476
f2ab5a41
MHM
477int
478PERL_ABS(a)
b2049988 479 int a
f2ab5a41
MHM
480
481void
482SVf(x)
b2049988
MHM
483 SV *x
484 PPCODE:
f2ab5a41 485#if { VERSION >= 5.004 }
b2049988 486 x = sv_2mortal(newSVpvf("[%"SVf"]", SVfARG(x)));
f2ab5a41 487#endif
b2049988
MHM
488 XPUSHs(x);
489 XSRETURN(1);
f2ab5a41 490
fd7af155
MHM
491void
492Perl_ppaddr_t(string)
b2049988
MHM
493 char *string
494 PREINIT:
495 Perl_ppaddr_t lower;
496 PPCODE:
497 lower = PL_ppaddr[OP_LC];
498 mXPUSHs(newSVpv(string, 0));
499 PUTBACK;
500 ENTER;
501 (void)*(lower)(aTHXR);
502 SPAGAIN;
503 LEAVE;
504 XSRETURN(1);
fd7af155 505
ea4b7f32
JH
506#if { VERSION >= 5.8.0 }
507
508void
509check_HeUTF8(utf8_key)
510 SV *utf8_key;
511 PREINIT:
512 HV *hash;
513 HE *ent;
514 STRLEN klen;
515 char *key;
516 PPCODE:
517 hash = newHV();
518
519 key = SvPV(utf8_key, klen);
520 if (SvUTF8(utf8_key)) klen *= -1;
521 hv_store(hash, key, klen, newSVpvs("string"), 0);
522 hv_iterinit(hash);
523 ent = hv_iternext(hash);
6efa7ebf
JH
524 if (ent) {
525 mXPUSHp((HeUTF8(ent) == 0 ? "norm" : "utf8"), 4);
526 }
ea4b7f32
JH
527 hv_undef(hash);
528
529
530#endif
531
532=tests plan => 41
adfe19db
MHM
533
534use vars qw($my_sv @my_av %my_hv);
535
adfe19db
MHM
536ok(&Devel::PPPort::boolSV(1));
537ok(!&Devel::PPPort::boolSV(0));
538
539$_ = "Fred";
540ok(&Devel::PPPort::DEFSV(), "Fred");
541ok(&Devel::PPPort::UNDERBAR(), "Fred");
542
95a7456e 543if ($] >= 5.009002 && $] < 5.023) {
0d0f8426 544 eval q{
b2049988 545 no warnings "deprecated";
e5b2cbd0 546 no if $^V > v5.17.9, warnings => "experimental::lexical_topic";
0d0f8426
MHM
547 my $_ = "Tony";
548 ok(&Devel::PPPort::DEFSV(), "Fred");
549 ok(&Devel::PPPort::UNDERBAR(), "Tony");
550 };
551}
552else {
553 ok(1);
554 ok(1);
555}
556
51d6c659
MHM
557my @r = &Devel::PPPort::DEFSV_modify();
558
559ok(@r == 3);
560ok($r[0], 'Fred');
561ok($r[1], 'DEFSV');
562ok($r[2], 'Fred');
563
564ok(&Devel::PPPort::DEFSV(), "Fred");
565
adfe19db
MHM
566eval { 1 };
567ok(!&Devel::PPPort::ERRSV());
568eval { cannot_call_this_one() };
569ok(&Devel::PPPort::ERRSV());
570
571ok(&Devel::PPPort::gv_stashpvn('Devel::PPPort', 0));
572ok(!&Devel::PPPort::gv_stashpvn('does::not::exist', 0));
573ok(&Devel::PPPort::gv_stashpvn('does::not::exist', 1));
574
575$my_sv = 1;
576ok(&Devel::PPPort::get_sv('my_sv', 0));
577ok(!&Devel::PPPort::get_sv('not_my_sv', 0));
578ok(&Devel::PPPort::get_sv('not_my_sv', 1));
579
580@my_av = (1);
581ok(&Devel::PPPort::get_av('my_av', 0));
582ok(!&Devel::PPPort::get_av('not_my_av', 0));
583ok(&Devel::PPPort::get_av('not_my_av', 1));
584
585%my_hv = (a=>1);
586ok(&Devel::PPPort::get_hv('my_hv', 0));
587ok(!&Devel::PPPort::get_hv('not_my_hv', 0));
588ok(&Devel::PPPort::get_hv('not_my_hv', 1));
589
590sub my_cv { 1 };
591ok(&Devel::PPPort::get_cv('my_cv', 0));
592ok(!&Devel::PPPort::get_cv('not_my_cv', 0));
593ok(&Devel::PPPort::get_cv('not_my_cv', 1));
594
9132e1a3 595ok(Devel::PPPort::dXSTARG(42), 43);
0d0f8426
MHM
596ok(Devel::PPPort::dAXMARK(4711), 4710);
597
598ok(Devel::PPPort::prepush(), 42);
9132e1a3 599
0d0f8426
MHM
600ok(join(':', Devel::PPPort::xsreturn(0)), 'test1');
601ok(join(':', Devel::PPPort::xsreturn(1)), 'test1:test2');
f2ab5a41
MHM
602
603ok(Devel::PPPort::PERL_ABS(42), 42);
604ok(Devel::PPPort::PERL_ABS(-13), 13);
605
606ok(Devel::PPPort::SVf(42), $] >= 5.004 ? '[42]' : '42');
607ok(Devel::PPPort::SVf('abc'), $] >= 5.004 ? '[abc]' : 'abc');
608
fd7af155
MHM
609ok(&Devel::PPPort::Perl_ppaddr_t("FOO"), "foo");
610
7bb03b24 611ok(&Devel::PPPort::ptrtests(), 63);
ea4b7f32
JH
612
613if ($] >= 5.009000) {
614 eval q{
615 ok(&Devel::PPPort::check_HeUTF8("hello"), "norm");
616 ok(&Devel::PPPort::check_HeUTF8("\N{U+263a}"), "utf8");
617 };
618} else {
619 ok(1, 1);
620 ok(1, 1);
621}