This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pat_advanced.t: Update test
[perl5.git] / regen / embed.pl
1 #!/usr/bin/perl -w
2
3 # Regenerate (overwriting only if changed):
4 #
5 #    embed.h
6 #    embedvar.h
7 #    perlapi.c
8 #    perlapi.h
9 #    proto.h
10 #
11 # from information stored in
12 #
13 #    embed.fnc
14 #    intrpvar.h
15 #    perlvars.h
16 #    regen/opcodes
17 #
18 # Accepts the standard regen_lib -q and -v args.
19 #
20 # This script is normally invoked from regen.pl.
21
22 require 5.004;  # keep this compatible, an old perl is all we may have before
23                 # we build the new one
24
25 use strict;
26
27 BEGIN {
28     # Get function prototypes
29     require './regen/regen_lib.pl';
30     require './regen/embed_lib.pl';
31 }
32
33 my $unflagged_pointers;
34
35 #
36 # See database of global and static function prototypes in embed.fnc
37 # This is used to generate prototype headers under various configurations,
38 # export symbols lists for different platforms, and macros to provide an
39 # implicit interpreter context argument.
40 #
41
42 my $error_count = 0;
43 sub die_at_end ($) { # Keeps going for now, but makes sure the regen doesn't
44                      # succeed.
45     warn shift;
46     $error_count++;
47 }
48
49 sub full_name ($$) { # Returns the function name with potentially the
50                      # prefixes 'S_' or 'Perl_'
51     my ($func, $flags) = @_;
52
53     return "Perl_$func" if $flags =~ /p/;
54     return "S_$func" if $flags =~ /[Si]/;
55     return $func;
56 }
57
58 sub open_print_header {
59     my ($file, $quote) = @_;
60
61     return open_new($file, '>',
62                     { file => $file, style => '*', by => 'regen/embed.pl',
63                       from => ['data in embed.fnc', 'regen/embed.pl',
64                                'regen/opcodes', 'intrpvar.h', 'perlvars.h'],
65                       final => "\nEdit those files and run 'make regen_headers' to effect changes.\n",
66                       copyright => [1993 .. 2009], quote => $quote });
67 }
68
69 my ($embed, $core, $ext, $api) = setup_embed();
70
71 # generate proto.h
72 {
73     my $pr = open_print_header("proto.h");
74     print $pr "START_EXTERN_C\n";
75     my $ret;
76
77     foreach (@$embed) {
78         if (@$_ == 1) {
79             print $pr "$_->[0]\n";
80             next;
81         }
82
83         my ($flags,$retval,$plain_func,@args) = @$_;
84         if ($flags =~ / ( [^AabCDdEefGhiMmNnOoPpRrSsTUuWXx] ) /x) {
85             die_at_end "flag $1 is not legal (for function $plain_func)";
86         }
87         my @nonnull;
88         my $args_assert_line = ( $flags !~ /G/ );
89         my $has_depth = ( $flags =~ /W/ );
90         my $has_context = ( $flags !~ /T/ );
91         my $never_returns = ( $flags =~ /r/ );
92         my $binarycompat = ( $flags =~ /b/ );
93         my $commented_out = ( $flags =~ /m/ );
94         my $is_malloc = ( $flags =~ /a/ );
95         my $can_ignore = ( $flags !~ /R/ ) && ( $flags !~ /P/ ) && !$is_malloc;
96         my @names_of_nn;
97         my $func;
98
99         if (! $can_ignore && $retval eq 'void') {
100             warn "It is nonsensical to require the return value of a void function ($plain_func) to be checked";
101         }
102
103         die_at_end "$plain_func: S and p flags are mutually exclusive"
104                                             if $flags =~ /S/ && $flags =~ /p/;
105         die_at_end "$plain_func: m and $1 flags are mutually exclusive"
106                                         if $flags =~ /m/ && $flags =~ /([pS])/;
107
108         die_at_end "$plain_func: u flag only usable with m" if $flags =~ /u/
109                                                             && $flags !~ /m/;
110
111         my $static_inline = 0;
112         if ($flags =~ /([Si])/) {
113             my $type;
114             if ($never_returns) {
115                 $type = $1 eq 'S' ? "PERL_STATIC_NO_RET" : "PERL_STATIC_INLINE_NO_RET";
116             }
117             else {
118                 $type = $1 eq 'S' ? "STATIC" : "PERL_STATIC_INLINE";
119             }
120             $retval = "$type $retval";
121             die_at_end "Don't declare static function '$plain_func' pure" if $flags =~ /P/;
122             $static_inline = $type eq 'PERL_STATIC_INLINE';
123         }
124         else {
125             if ($never_returns) {
126                 $retval = "PERL_CALLCONV_NO_RET $retval";
127             }
128             else {
129                 $retval = "PERL_CALLCONV $retval";
130             }
131         }
132
133         die_at_end "For '$plain_func', M flag requires p flag"
134                                             if $flags =~ /M/ && $flags !~ /p/;
135         die_at_end "For '$plain_func', C flag requires one of [pim] flag"
136                                             if $flags =~ /C/ && $flags !~ /[ibmp]/;
137         die_at_end "For '$plain_func', X flag requires p or i flag"
138                                             if $flags =~ /X/ && $flags !~ /[ip]/;
139         die_at_end "For '$plain_func', X and m flags are mutually exclusive"
140                                             if $flags =~ /X/ && $flags =~ /m/;
141         die_at_end "For '$plain_func', i with [ACX] requires p flag"
142                         if $flags =~ /i/ && $flags =~ /[ACX]/ && $flags !~ /p/;
143         die_at_end "For '$plain_func', b and m flags are mutually exclusive"
144                  . " (try M flag)" if $flags =~ /b/ && $flags =~ /m/;
145         die_at_end "For '$plain_func', b flag without M flag requires D flag"
146                             if $flags =~ /b/ && $flags !~ /M/ && $flags !~ /D/;
147
148         $func = full_name($plain_func, $flags);
149         $ret = "";
150         $ret .= "$retval\t$func(";
151         if ( $has_context ) {
152             $ret .= @args ? "pTHX_ " : "pTHX";
153         }
154         if (@args) {
155             die_at_end "n flag is contradicted by having arguments"
156                                                                 if $flags =~ /n/;
157             my $n;
158             for my $arg ( @args ) {
159                 ++$n;
160                 if ( $arg =~ /\*/ && $arg !~ /\b(NN|NULLOK)\b/ ) {
161                     warn "$func: $arg needs NN or NULLOK\n";
162                     ++$unflagged_pointers;
163                 }
164                 my $nn = ( $arg =~ s/\s*\bNN\b\s+// );
165                 push( @nonnull, $n ) if $nn;
166
167                 my $nullok = ( $arg =~ s/\s*\bNULLOK\b\s+// ); # strip NULLOK with no effect
168
169                 # Make sure each arg has at least a type and a var name.
170                 # An arg of "int" is valid C, but want it to be "int foo".
171                 my $temp_arg = $arg;
172                 $temp_arg =~ s/\*//g;
173                 $temp_arg =~ s/\s*\bstruct\b\s*/ /g;
174                 if ( ($temp_arg ne "...")
175                      && ($temp_arg !~ /\w+\s+(\w+)(?:\[\d+\])?\s*$/) ) {
176                     die_at_end "$func: $arg ($n) doesn't have a name\n";
177                 }
178                 if (defined $1 && $nn && !($commented_out && !$binarycompat)) {
179                     push @names_of_nn, $1;
180                 }
181             }
182             $ret .= join ", ", @args;
183         }
184         else {
185             $ret .= "void" if !$has_context;
186         }
187         $ret .= " _pDEPTH" if $has_depth;
188         $ret .= ")";
189         my @attrs;
190         if ( $flags =~ /r/ ) {
191             push @attrs, "__attribute__noreturn__";
192         }
193         if ( $flags =~ /D/ ) {
194             push @attrs, "__attribute__deprecated__";
195         }
196         if ( $is_malloc ) {
197             push @attrs, "__attribute__malloc__";
198         }
199         if ( !$can_ignore ) {
200             push @attrs, "__attribute__warn_unused_result__";
201         }
202         if ( $flags =~ /P/ ) {
203             push @attrs, "__attribute__pure__";
204         }
205         if( $flags =~ /f/ ) {
206             my $prefix  = $has_context ? 'pTHX_' : '';
207             my ($args, $pat);
208             if ($args[-1] eq '...') {
209                 $args   = scalar @args;
210                 $pat    = $args - 1;
211                 $args   = $prefix . $args;
212             }
213             else {
214                 # don't check args, and guess which arg is the pattern
215                 # (one of 'fmt', 'pat', 'f'),
216                 $args = 0;
217                 my @fmts = grep $args[$_] =~ /\b(f|pat|fmt)$/, 0..$#args;
218                 if (@fmts != 1) {
219                     die "embed.pl: '$plain_func': can't determine pattern arg\n";
220                 }
221                 $pat = $fmts[0] + 1;
222             }
223             my $macro   = grep($_ == $pat, @nonnull)
224                                 ? '__attribute__format__'
225                                 : '__attribute__format__null_ok__';
226             if ($plain_func =~ /strftime/) {
227                 push @attrs, sprintf "%s(__strftime__,%s1,0)", $macro, $prefix;
228             }
229             else {
230                 push @attrs, sprintf "%s(__printf__,%s%d,%s)", $macro,
231                                     $prefix, $pat, $args;
232             }
233         }
234         if ( @attrs ) {
235             $ret .= "\n";
236             $ret .= join( "\n", map { "\t\t\t$_" } @attrs );
237         }
238         $ret .= ";";
239         $ret = "/* $ret */" if $commented_out;
240
241         $ret .= "\n#define PERL_ARGS_ASSERT_\U$plain_func\E"
242                                             if $args_assert_line || @names_of_nn;
243         $ret .= "\t\\\n\t" . join '; ', map "assert($_)", @names_of_nn
244                                                                 if @names_of_nn;
245
246         $ret = "#ifndef PERL_NO_INLINE_FUNCTIONS\n$ret\n#endif" if $static_inline;
247         $ret = "#ifndef NO_MATHOMS\n$ret\n#endif" if $binarycompat;
248         $ret .= @attrs ? "\n\n" : "\n";
249
250         print $pr $ret;
251     }
252
253     print $pr <<'EOF';
254 #ifdef PERL_CORE
255 #  include "pp_proto.h"
256 #endif
257 END_EXTERN_C
258 EOF
259
260     read_only_bottom_close_and_rename($pr) if ! $error_count;
261 }
262
263 die_at_end "$unflagged_pointers pointer arguments to clean up\n" if $unflagged_pointers;
264
265 sub readvars {
266     my ($file, $pre) = @_;
267     local (*FILE, $_);
268     my %seen;
269     open(FILE, '<', $file)
270         or die "embed.pl: Can't open $file: $!\n";
271     while (<FILE>) {
272         s/[ \t]*#.*//;          # Delete comments.
273         if (/PERLVARA?I?C?\($pre,\s*(\w+)/) {
274             die_at_end "duplicate symbol $1 while processing $file line $.\n"
275                 if $seen{$1}++;
276         }
277     }
278     close(FILE);
279     return sort keys %seen;
280 }
281
282 my @intrp = readvars 'intrpvar.h','I';
283 my @globvar = readvars 'perlvars.h','G';
284
285 sub hide {
286     my ($from, $to, $indent) = @_;
287     $indent = '' unless defined $indent;
288     my $t = int(length("$indent$from") / 8);
289     "#${indent}define $from" . "\t" x ($t < 3 ? 3 - $t : 1) . "$to\n";
290 }
291
292 sub multon ($$$) {
293     my ($sym,$pre,$ptr) = @_;
294     hide("PL_$sym", "($ptr$pre$sym)");
295 }
296
297 my $em = open_print_header('embed.h');
298
299 print $em <<'END';
300 /* (Doing namespace management portably in C is really gross.) */
301
302 /* By defining PERL_NO_SHORT_NAMES (not done by default) the short forms
303  * (like warn instead of Perl_warn) for the API are not defined.
304  * Not defining the short forms is a good thing for cleaner embedding. */
305
306 #ifndef PERL_NO_SHORT_NAMES
307
308 /* Hide global symbols */
309
310 END
311
312 my @az = ('a'..'z');
313
314 sub embed_h {
315     my ($guard, $funcs) = @_;
316     print $em "$guard\n" if $guard;
317
318     my $lines;
319     foreach (@$funcs) {
320         if (@$_ == 1) {
321             my $cond = $_->[0];
322             # Indent the conditionals if we are wrapped in an #if/#endif pair.
323             $cond =~ s/#(.*)/#  $1/ if $guard;
324             $lines .= "$cond\n";
325             next;
326         }
327         my $ret = "";
328         my ($flags,$retval,$func,@args) = @$_;
329         unless ($flags =~ /[omM]/) {
330             my $args = scalar @args;
331             if ($flags =~ /T/) {
332                 my $full_name = full_name($func, $flags);
333                 next if $full_name eq $func;    # Don't output a no-op.
334                 $ret = hide($func, $full_name);
335             }
336             elsif ($args and $args[$args-1] =~ /\.\.\./) {
337                 if ($flags =~ /p/) {
338                     # we're out of luck for varargs functions under CPP
339                     # So we can only do these macros for no implicit context:
340                     $ret = "#ifndef PERL_IMPLICIT_CONTEXT\n"
341                         . hide($func, full_name($func, $flags)) . "#endif\n";
342                 }
343             }
344             else {
345                 my $alist = join(",", @az[0..$args-1]);
346                 $ret = "#define $func($alist)";
347                 my $t = int(length($ret) / 8);
348                 $ret .=  "\t" x ($t < 4 ? 4 - $t : 1);
349                 $ret .= full_name($func, $flags) . "(aTHX";
350                 $ret .= "_ " if $alist;
351                 $ret .= $alist;
352                 if ($flags =~ /W/) {
353                     if ($alist) {
354                         $ret .= " _aDEPTH";
355                     } else {
356                         die "Can't use W without other args (currently)";
357                     }
358                 }
359                 $ret .= ")\n";
360             }
361             $ret = "#ifndef NO_MATHOMS\n$ret#endif\n" if $flags =~ /b/;
362         }
363         $lines .= $ret;
364     }
365     # Prune empty #if/#endif pairs.
366     while ($lines =~ s/#\s*if[^\n]+\n#\s*endif\n//) {
367     }
368     # Merge adjacent blocks.
369     while ($lines =~ s/(#ifndef PERL_IMPLICIT_CONTEXT
370 [^\n]+
371 )#endif
372 #ifndef PERL_IMPLICIT_CONTEXT
373 /$1/) {
374     }
375
376     print $em $lines;
377     print $em "#endif\n" if $guard;
378 }
379
380 embed_h('', $api);
381 embed_h('#if defined(PERL_CORE) || defined(PERL_EXT)', $ext);
382 embed_h('#ifdef PERL_CORE', $core);
383
384 print $em <<'END';
385
386 #endif  /* #ifndef PERL_NO_SHORT_NAMES */
387
388 /* Compatibility stubs.  Compile extensions with -DPERL_NOCOMPAT to
389    disable them.
390  */
391
392 #if !defined(PERL_CORE)
393 #  define sv_setptrobj(rv,ptr,name)     sv_setref_iv(rv,name,PTR2IV(ptr))
394 #  define sv_setptrref(rv,ptr)          sv_setref_iv(rv,NULL,PTR2IV(ptr))
395 #endif
396
397 #if !defined(PERL_CORE) && !defined(PERL_NOCOMPAT)
398
399 /* Compatibility for various misnamed functions.  All functions
400    in the API that begin with "perl_" (not "Perl_") take an explicit
401    interpreter context pointer.
402    The following are not like that, but since they had a "perl_"
403    prefix in previous versions, we provide compatibility macros.
404  */
405 #  define perl_atexit(a,b)              call_atexit(a,b)
406 END
407
408 foreach (@$embed) {
409     my ($flags, $retval, $func, @args) = @$_;
410     next unless $func;
411     next unless $flags =~ /O/;
412
413     my $alist = join ",", @az[0..$#args];
414     my $ret = "#  define perl_$func($alist)";
415     my $t = (length $ret) >> 3;
416     $ret .=  "\t" x ($t < 5 ? 5 - $t : 1);
417     print $em "$ret$func($alist)\n";
418 }
419
420 my @nocontext;
421 {
422     my (%has_va, %has_nocontext);
423     foreach (@$embed) {
424         next unless @$_ > 1;
425         ++$has_va{$_->[2]} if $_->[-1] =~ /\.\.\./;
426         ++$has_nocontext{$1} if $_->[2] =~ /(.*)_nocontext/;
427     }
428
429     @nocontext = sort grep {
430         $has_nocontext{$_}
431             && !/printf/ # Not clear to me why these are skipped but they are.
432     } keys %has_va;
433 }
434
435 print $em <<'END';
436
437 /* varargs functions can't be handled with CPP macros. :-(
438    This provides a set of compatibility functions that don't take
439    an extra argument but grab the context pointer using the macro
440    dTHX.
441  */
442 #if defined(PERL_IMPLICIT_CONTEXT) && !defined(PERL_NO_SHORT_NAMES)
443 END
444
445 foreach (@nocontext) {
446     print $em hide($_, "Perl_${_}_nocontext", "  ");
447 }
448
449 print $em <<'END';
450 #endif
451
452 #endif /* !defined(PERL_CORE) && !defined(PERL_NOCOMPAT) */
453
454 #if !defined(PERL_IMPLICIT_CONTEXT)
455 /* undefined symbols, point them back at the usual ones */
456 END
457
458 foreach (@nocontext) {
459     print $em hide("Perl_${_}_nocontext", "Perl_$_", "  ");
460 }
461
462 print $em <<'END';
463 #endif
464 END
465
466 read_only_bottom_close_and_rename($em) if ! $error_count;
467
468 $em = open_print_header('embedvar.h');
469
470 print $em <<'END';
471 /* (Doing namespace management portably in C is really gross.) */
472
473 /*
474    The following combinations of MULTIPLICITY and PERL_IMPLICIT_CONTEXT
475    are supported:
476      1) none
477      2) MULTIPLICITY    # supported for compatibility
478      3) MULTIPLICITY && PERL_IMPLICIT_CONTEXT
479
480    All other combinations of these flags are errors.
481
482    only #3 is supported directly, while #2 is a special
483    case of #3 (supported by redefining vTHX appropriately).
484 */
485
486 #if defined(MULTIPLICITY)
487 /* cases 2 and 3 above */
488
489 #  if defined(PERL_IMPLICIT_CONTEXT)
490 #    define vTHX        aTHX
491 #  else
492 #    define vTHX        PERL_GET_INTERP
493 #  endif
494
495 END
496
497 my $sym;
498
499 for $sym (@intrp) {
500     if ($sym eq 'sawampersand') {
501         print $em "#ifndef PL_sawampersand\n";
502     }
503     print $em multon($sym,'I','vTHX->');
504     if ($sym eq 'sawampersand') {
505         print $em "#endif\n";
506     }
507 }
508
509 print $em <<'END';
510
511 #endif  /* MULTIPLICITY */
512
513 #if defined(PERL_GLOBAL_STRUCT)
514
515 END
516
517 for $sym (@globvar) {
518     print $em "#ifdef OS2\n" if $sym eq 'sh_path';
519     print $em "#ifdef __VMS\n" if $sym eq 'perllib_sep';
520     print $em multon($sym,   'G','my_vars->');
521     print $em multon("G$sym",'', 'my_vars->');
522     print $em "#endif\n" if $sym eq 'sh_path';
523     print $em "#endif\n" if $sym eq 'perllib_sep';
524 }
525
526 print $em <<'END';
527
528 #endif /* PERL_GLOBAL_STRUCT */
529 END
530
531 read_only_bottom_close_and_rename($em) if ! $error_count;
532
533 my $capih = open_print_header('perlapi.h');
534
535 print $capih <<'EOT';
536 /* declare accessor functions for Perl variables */
537 #ifndef __perlapi_h__
538 #define __perlapi_h__
539
540 #if defined (MULTIPLICITY) && defined (PERL_GLOBAL_STRUCT)
541
542 START_EXTERN_C
543
544 #undef PERLVAR
545 #undef PERLVARA
546 #undef PERLVARI
547 #undef PERLVARIC
548 #define PERLVAR(p,v,t)  EXTERN_C t* Perl_##p##v##_ptr(pTHX);
549 #define PERLVARA(p,v,n,t)       typedef t PL_##v##_t[n];                \
550                         EXTERN_C PL_##v##_t* Perl_##p##v##_ptr(pTHX);
551 #define PERLVARI(p,v,t,i)       PERLVAR(p,v,t)
552 #define PERLVARIC(p,v,t,i) PERLVAR(p,v, const t)
553
554 #include "perlvars.h"
555
556 #undef PERLVAR
557 #undef PERLVARA
558 #undef PERLVARI
559 #undef PERLVARIC
560
561 END_EXTERN_C
562
563 #if defined(PERL_CORE)
564
565 /* accessor functions for Perl "global" variables */
566
567 /* these need to be mentioned here, or most linkers won't put them in
568    the perl executable */
569
570 #ifndef PERL_NO_FORCE_LINK
571
572 START_EXTERN_C
573
574 #ifndef DOINIT
575 EXTCONST void * const PL_force_link_funcs[];
576 #else
577 EXTCONST void * const PL_force_link_funcs[] = {
578 #undef PERLVAR
579 #undef PERLVARA
580 #undef PERLVARI
581 #undef PERLVARIC
582 #define PERLVAR(p,v,t)          (void*)Perl_##p##v##_ptr,
583 #define PERLVARA(p,v,n,t)       PERLVAR(p,v,t)
584 #define PERLVARI(p,v,t,i)       PERLVAR(p,v,t)
585 #define PERLVARIC(p,v,t,i)      PERLVAR(p,v,t)
586
587 /* In Tru64 (__DEC && __osf__) the cc option -std1 causes that one
588  * cannot cast between void pointers and function pointers without
589  * info level warnings.  The PL_force_link_funcs[] would cause a few
590  * hundred of those warnings.  In code one can circumnavigate this by using
591  * unions that overlay the different pointers, but in declarations one
592  * cannot use this trick.  Therefore we just disable the warning here
593  * for the duration of the PL_force_link_funcs[] declaration. */
594
595 #if defined(__DECC) && defined(__osf__)
596 #pragma message save
597 #pragma message disable (nonstandcast)
598 #endif
599
600 #include "perlvars.h"
601
602 #if defined(__DECC) && defined(__osf__)
603 #pragma message restore
604 #endif
605
606 #undef PERLVAR
607 #undef PERLVARA
608 #undef PERLVARI
609 #undef PERLVARIC
610 };
611 #endif  /* DOINIT */
612
613 END_EXTERN_C
614
615 #endif  /* PERL_NO_FORCE_LINK */
616
617 #else   /* !PERL_CORE */
618
619 EOT
620
621 foreach $sym (@globvar) {
622     print $capih
623         "#undef  PL_$sym\n" . hide("PL_$sym", "(*Perl_G${sym}_ptr(NULL))");
624 }
625
626 print $capih <<'EOT';
627
628 #endif /* !PERL_CORE */
629 #endif /* MULTIPLICITY && PERL_GLOBAL_STRUCT */
630
631 #endif /* __perlapi_h__ */
632 EOT
633
634 read_only_bottom_close_and_rename($capih) if ! $error_count;
635
636 my $capi = open_print_header('perlapi.c', <<'EOQ');
637  *
638  *
639  * Up to the threshold of the door there mounted a flight of twenty-seven
640  * broad stairs, hewn by some unknown art of the same black stone.  This
641  * was the only entrance to the tower; ...
642  *
643  *     [p.577 of _The Lord of the Rings_, III/x: "The Voice of Saruman"]
644  *
645  */
646 EOQ
647
648 print $capi <<'EOT';
649 #include "EXTERN.h"
650 #include "perl.h"
651 #include "perlapi.h"
652
653 #if defined (MULTIPLICITY) && defined (PERL_GLOBAL_STRUCT)
654
655 /* accessor functions for Perl "global" variables */
656 START_EXTERN_C
657
658 #undef PERLVARI
659 #define PERLVARI(p,v,t,i) PERLVAR(p,v,t)
660
661 #undef PERLVAR
662 #undef PERLVARA
663 #define PERLVAR(p,v,t)          t* Perl_##p##v##_ptr(pTHX)              \
664                         { dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); }
665 #define PERLVARA(p,v,n,t)       PL_##v##_t* Perl_##p##v##_ptr(pTHX)     \
666                         { dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); }
667 #undef PERLVARIC
668 #define PERLVARIC(p,v,t,i)      \
669                         const t* Perl_##p##v##_ptr(pTHX)                \
670                         { PERL_UNUSED_CONTEXT; return (const t *)&(PL_##v); }
671 #include "perlvars.h"
672
673 #undef PERLVAR
674 #undef PERLVARA
675 #undef PERLVARI
676 #undef PERLVARIC
677
678 END_EXTERN_C
679
680 #endif /* MULTIPLICITY && PERL_GLOBAL_STRUCT */
681 EOT
682
683 read_only_bottom_close_and_rename($capi) if ! $error_count;
684
685 die "$error_count errors found" if $error_count;
686
687 # ex: set ts=8 sts=4 sw=4 noet: