Codebase list libextutils-parsexs-perl / db4227c
[svn-upgrade] Integrating new upstream version, libextutils-parsexs-perl (2.220000) Jonathan Yu 14 years ago
8 changed file(s) with 151 addition(s) and 47 deletion(s). Raw diff Collapse all Expand all
00 Revision history for Perl extension ExtUtils::ParseXS.
1
2 2.22 - Mon Jan 11 15:00:07 EST 2010
3
4 No changes from 2.21_02
5
6 2.21_02 - Sat Dec 19 10:55:41 EST 2009
7
8 Bug fixes:
9
10 - fixed bugs and added tests for INCLUDE_COMMAND [Steffen Mueller]
11
12 2.21_01 - Sat Dec 19 07:22:44 EST 2009
13
14 Enhancements:
15
16 - New 'INCLUDE_COMMAND' directive [Steffen Mueller]
17
18 Bug fixes:
19
20 - Workaround for empty newXS macro found in P5NCI [Goro Fuji]
121
222 2.21 - Mon Oct 5 11:17:53 EDT 2009
323
1131
1232 Bug fixes:
1333 - Use "char* file" for perl < 5.9, not "char[] file"; fixes mod_perl
14 breakage due to prior attempts to fix RT#48104 [David Golden]
34 breakage due to prior attempts to fix RT#48104 [David Golden]
1535
1636 2.20_06 - Fri Oct 2 23:45:45 EDT 2009
1737
6181 2.20_03 - Thu Jul 23 23:14:50 EDT 2009
6282
6383 Bug fixes:
64 - Fixed "const char *" errors for 5.8.8 (and older) (RT#48104)
65 [Vincent Pit]
84 - Fixed "const char *" errors for 5.8.8 (and older) (RT#48104)
85 [Vincent Pit]
6686 - Added newline before a preprocessor directive (RT#30673)
6787 [patch by hjp]
6888
1111 t/bugs/typemap
1212 t/include/nscore.h
1313 t/include/nsUniversalDetector.h
14 t/lib/IncludeTester.pm
1415 t/more.t
1516 t/typemap
1617 t/usage.t
00 ---
1 name: ExtUtils-ParseXS
2 version: 2.21
1 abstract: 'converts Perl XS code into C code'
32 author:
43 - 'Ken Williams, <ken@mathforum.org>'
54 - 'David Golden, <dagolden@cpan.org>'
6 abstract: converts Perl XS code into C code
7 license: perl
8 resources:
9 MailingList: mailto:perl5-porters@perl.org
10 bugtracker: http://rt.cpan.org/Dist/Display.html?Queue=ExtUtils-ParseXS
11 license: http://dev.perl.org/licenses/
12 repository: git://github.com/dagolden/extutils-parsexs.git
135 build_requires:
146 Carp: 0
157 DynaLoader: 0
168 ExtUtils::CBuilder: 0
179 Test::More: 0.47
10 generated_by: 'Module::Build version 0.3515'
11 license: perl
12 meta-spec:
13 url: http://module-build.sourceforge.net/META-spec-v1.4.html
14 version: 1.4
15 name: ExtUtils-ParseXS
16 provides:
17 ExtUtils::ParseXS:
18 file: lib/ExtUtils/ParseXS.pm
19 version: 2.22
1820 requires:
1921 Cwd: 0
2022 Exporter: 0
2123 File::Basename: 0
2224 File::Spec: 0
2325 Symbol: 0
24 provides:
25 ExtUtils::ParseXS:
26 file: lib/ExtUtils/ParseXS.pm
27 version: 2.21
28 generated_by: Module::Build version 0.3502
29 meta-spec:
30 url: http://module-build.sourceforge.net/META-spec-v1.4.html
31 version: 1.4
26 resources:
27 MailingList: mailto:perl5-porters@perl.org
28 bugtracker: http://rt.cpan.org/Dist/Display.html?Queue=ExtUtils-ParseXS
29 license: http://dev.perl.org/licenses/
30 repository: git://github.com/dagolden/extutils-parsexs.git
31 version: 2.22
0 # Note: this file was auto-generated by Module::Build::Compat version 0.35_02
0 # Note: this file was auto-generated by Module::Build::Compat version 0.35_15
11 use ExtUtils::MakeMaker;
22 WriteMakefile
33 (
1717 my($XSS_work_idx, $cpp_next_tmp);
1818
1919 use vars qw($VERSION);
20 $VERSION = '2.21';
20 $VERSION = '2.22';
2121 $VERSION = eval $VERSION if $VERSION =~ /_/;
2222
2323 use vars qw(%input_expr %output_expr $ProtoUsed @InitFileCode $FH $proto_re $Overload $errors $Fallback
229229
230230 # Match an XS keyword
231231 $BLOCK_re= '\s*(' . join('|', qw(
232 REQUIRE BOOT CASE PREINIT INPUT INIT CODE PPCODE OUTPUT
233 CLEANUP ALIAS ATTRS PROTOTYPES PROTOTYPE VERSIONCHECK INCLUDE
234 SCOPE INTERFACE INTERFACE_MACRO C_ARGS POSTCALL OVERLOAD FALLBACK
232 REQUIRE BOOT CASE PREINIT INPUT INIT CODE PPCODE
233 OUTPUT CLEANUP ALIAS ATTRS PROTOTYPES PROTOTYPE
234 VERSIONCHECK INCLUDE INCLUDE_COMMAND SCOPE INTERFACE
235 INTERFACE_MACRO C_ARGS POSTCALL OVERLOAD FALLBACK
235236 )) . "|$END)\\s*:";
236237
237238
447448 $xsreturn = 0;
448449
449450 $_ = shift(@line);
450 while (my $kwd = check_keyword("REQUIRE|PROTOTYPES|FALLBACK|VERSIONCHECK|INCLUDE|SCOPE")) {
451 while (my $kwd = check_keyword("REQUIRE|PROTOTYPES|FALLBACK|VERSIONCHECK|INCLUDE(?:_COMMAND)?|SCOPE")) {
451452 &{"${kwd}_handler"}() ;
452453 next PARAGRAPH unless @line ;
453454 $_ = shift(@line);
933934 EOF
934935 }
935936 }
937 elsif($newXS eq 'newXS'){ # work around P5NCI's empty newXS macro
938 push(@InitFileCode,
939 " ${newXS}(\"$pname\", XS_$Full_func_name, file$proto);\n");
940 }
936941 else {
937942 push(@InitFileCode,
938943 " (void)${newXS}(\"$pname\", XS_$Full_func_name, file$proto);\n");
14801485
14811486 }
14821487
1483 sub INCLUDE_handler ()
1488 sub PushXSStack
14841489 {
1485 # the rest of the current line should contain a valid filename
1486
1487 TrimWhitespace($_) ;
1488
1489 death("INCLUDE: filename missing")
1490 unless $_ ;
1491
1492 death("INCLUDE: output pipe is illegal")
1493 if /^\s*\|/ ;
1494
1495 # simple minded recursion detector
1496 death("INCLUDE loop detected")
1497 if $IncludedFiles{$_} ;
1498
1499 ++ $IncludedFiles{$_} unless /\|\s*$/ ;
1500
15011490 # Save the current file context.
15021491 push(@XSStack, {
1503 type => 'file',
1492 type => 'file',
15041493 LastLine => $lastline,
15051494 LastLineNo => $lastline_no,
15061495 Line => \@line,
15101499 Handle => $FH,
15111500 }) ;
15121501
1502 }
1503
1504 sub INCLUDE_handler ()
1505 {
1506 # the rest of the current line should contain a valid filename
1507
1508 TrimWhitespace($_) ;
1509
1510 death("INCLUDE: filename missing")
1511 unless $_ ;
1512
1513 death("INCLUDE: output pipe is illegal")
1514 if /^\s*\|/ ;
1515
1516 # simple minded recursion detector
1517 death("INCLUDE loop detected")
1518 if $IncludedFiles{$_} ;
1519
1520 ++ $IncludedFiles{$_} unless /\|\s*$/ ;
1521
1522 Warn("The INCLUDE directive with a command is deprecated." .
1523 " Use INCLUDE_COMMAND instead!")
1524 if /\|\s*$/ ;
1525
1526 PushXSStack();
1527
15131528 $FH = Symbol::gensym();
15141529
15151530 # open the new file
15341549
15351550 $lastline = $_ ;
15361551 $lastline_no = $. ;
1537
1552 }
1553
1554 sub INCLUDE_COMMAND_handler ()
1555 {
1556 # the rest of the current line should contain a valid command
1557
1558 TrimWhitespace($_) ;
1559
1560 death("INCLUDE_COMMAND: command missing")
1561 unless $_ ;
1562
1563 death("INCLUDE_COMMAND: pipes are illegal")
1564 if /^\s*\|/ or /\|\s*$/ ;
1565
1566 PushXSStack();
1567
1568 $FH = Symbol::gensym();
1569
1570 # If $^X is used in INCLUDE_COMMAND, we know it's supposed to be
1571 # the same perl interpreter as we're currently running
1572 s/^\s*\$\^X/$^X/;
1573
1574 # open the new file
1575 open ($FH, "-|", "$_")
1576 or death("Cannot run command '$_' to include its output: $!") ;
1577
1578 print Q(<<"EOF");
1579 #
1580 #/* INCLUDE_COMMAND: Including output of '$_' from '$filename' */
1581 #
1582 EOF
1583
1584 $filename = $_ ;
1585 $filepathname = "$dir/$filename";
1586
1587 # Prime the pump by reading the first
1588 # non-blank line
1589
1590 # skip leading blank lines
1591 while (<$FH>) {
1592 last unless /^\s*$/ ;
1593 }
1594
1595 $lastline = $_ ;
1596 $lastline_no = $. ;
15381597 }
15391598
15401599 sub PopFile()
105105 int
106106 len(char* s, int length(s))
107107
108 INCLUDE_COMMAND: $^X -Ilib -It/lib -MIncludeTester -e IncludeTester::print_xs
109
108110 #if 1
109111
110112 INCLUDE: XSInclude.xsh
0 package IncludeTester;
1 use strict;
2
3 sub print_xs {
4 print <<'HERE';
5
6 int
7 sum(a, b)
8 int a
9 int b
10 CODE:
11 RETVAL = a + b;
12 OUTPUT:
13 RETVAL
14
15 HERE
16 }
17
18 1;
19
77 use attributes;
88 use overload;
99
10 plan tests => 24;
10 plan tests => 25;
1111
1212 my ($source_file, $obj_file, $lib_file);
1313
4141 }
4242
4343 SKIP: {
44 skip "no dynamic loading", 5
44 skip "no dynamic loading", 6
4545 if !$b->have_compiler || !$Config{usedl};
4646 my $module = 'XSMore';
4747 $lib_file = $b->link( objects => $obj_file, module_name => $module );
8787
8888 is XSMore::len("foo"), 3, 'the length keyword';
8989
90 is XSMore::sum(5, 9), 14, 'the INCLUDE_COMMAND directive';
91
9092 # Win32 needs to close the DLL before it can unlink it, but unfortunately
9193 # dl_unload_file was missing on Win32 prior to perl change #24679!
9294 if ($^O eq 'MSWin32' and defined &DynaLoader::dl_unload_file) {