[svn-upgrade] Integrating new upstream version, libextutils-parsexs-perl (2.220000)
Jonathan Yu
14 years ago
0 | 0 | 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] | |
1 | 21 | |
2 | 22 | 2.21 - Mon Oct 5 11:17:53 EDT 2009 |
3 | 23 | |
11 | 31 | |
12 | 32 | Bug fixes: |
13 | 33 | - 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] | |
15 | 35 | |
16 | 36 | 2.20_06 - Fri Oct 2 23:45:45 EDT 2009 |
17 | 37 | |
61 | 81 | 2.20_03 - Thu Jul 23 23:14:50 EDT 2009 |
62 | 82 | |
63 | 83 | 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] | |
66 | 86 | - Added newline before a preprocessor directive (RT#30673) |
67 | 87 | [patch by hjp] |
68 | 88 |
11 | 11 | t/bugs/typemap |
12 | 12 | t/include/nscore.h |
13 | 13 | t/include/nsUniversalDetector.h |
14 | t/lib/IncludeTester.pm | |
14 | 15 | t/more.t |
15 | 16 | t/typemap |
16 | 17 | t/usage.t |
0 | 0 | --- |
1 | name: ExtUtils-ParseXS | |
2 | version: 2.21 | |
1 | abstract: 'converts Perl XS code into C code' | |
3 | 2 | author: |
4 | 3 | - 'Ken Williams, <ken@mathforum.org>' |
5 | 4 | - '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 | |
13 | 5 | build_requires: |
14 | 6 | Carp: 0 |
15 | 7 | DynaLoader: 0 |
16 | 8 | ExtUtils::CBuilder: 0 |
17 | 9 | 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 | |
18 | 20 | requires: |
19 | 21 | Cwd: 0 |
20 | 22 | Exporter: 0 |
21 | 23 | File::Basename: 0 |
22 | 24 | File::Spec: 0 |
23 | 25 | 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 | |
1 | 1 | use ExtUtils::MakeMaker; |
2 | 2 | WriteMakefile |
3 | 3 | ( |
17 | 17 | my($XSS_work_idx, $cpp_next_tmp); |
18 | 18 | |
19 | 19 | use vars qw($VERSION); |
20 | $VERSION = '2.21'; | |
20 | $VERSION = '2.22'; | |
21 | 21 | $VERSION = eval $VERSION if $VERSION =~ /_/; |
22 | 22 | |
23 | 23 | use vars qw(%input_expr %output_expr $ProtoUsed @InitFileCode $FH $proto_re $Overload $errors $Fallback |
229 | 229 | |
230 | 230 | # Match an XS keyword |
231 | 231 | $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 | |
235 | 236 | )) . "|$END)\\s*:"; |
236 | 237 | |
237 | 238 | |
447 | 448 | $xsreturn = 0; |
448 | 449 | |
449 | 450 | $_ = 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")) { | |
451 | 452 | &{"${kwd}_handler"}() ; |
452 | 453 | next PARAGRAPH unless @line ; |
453 | 454 | $_ = shift(@line); |
933 | 934 | EOF |
934 | 935 | } |
935 | 936 | } |
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 | } | |
936 | 941 | else { |
937 | 942 | push(@InitFileCode, |
938 | 943 | " (void)${newXS}(\"$pname\", XS_$Full_func_name, file$proto);\n"); |
1480 | 1485 | |
1481 | 1486 | } |
1482 | 1487 | |
1483 | sub INCLUDE_handler () | |
1488 | sub PushXSStack | |
1484 | 1489 | { |
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 | ||
1501 | 1490 | # Save the current file context. |
1502 | 1491 | push(@XSStack, { |
1503 | type => 'file', | |
1492 | type => 'file', | |
1504 | 1493 | LastLine => $lastline, |
1505 | 1494 | LastLineNo => $lastline_no, |
1506 | 1495 | Line => \@line, |
1510 | 1499 | Handle => $FH, |
1511 | 1500 | }) ; |
1512 | 1501 | |
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 | ||
1513 | 1528 | $FH = Symbol::gensym(); |
1514 | 1529 | |
1515 | 1530 | # open the new file |
1534 | 1549 | |
1535 | 1550 | $lastline = $_ ; |
1536 | 1551 | $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 = $. ; | |
1538 | 1597 | } |
1539 | 1598 | |
1540 | 1599 | sub PopFile() |
105 | 105 | int |
106 | 106 | len(char* s, int length(s)) |
107 | 107 | |
108 | INCLUDE_COMMAND: $^X -Ilib -It/lib -MIncludeTester -e IncludeTester::print_xs | |
109 | ||
108 | 110 | #if 1 |
109 | 111 | |
110 | 112 | 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 |
7 | 7 | use attributes; |
8 | 8 | use overload; |
9 | 9 | |
10 | plan tests => 24; | |
10 | plan tests => 25; | |
11 | 11 | |
12 | 12 | my ($source_file, $obj_file, $lib_file); |
13 | 13 | |
41 | 41 | } |
42 | 42 | |
43 | 43 | SKIP: { |
44 | skip "no dynamic loading", 5 | |
44 | skip "no dynamic loading", 6 | |
45 | 45 | if !$b->have_compiler || !$Config{usedl}; |
46 | 46 | my $module = 'XSMore'; |
47 | 47 | $lib_file = $b->link( objects => $obj_file, module_name => $module ); |
87 | 87 | |
88 | 88 | is XSMore::len("foo"), 3, 'the length keyword'; |
89 | 89 | |
90 | is XSMore::sum(5, 9), 14, 'the INCLUDE_COMMAND directive'; | |
91 | ||
90 | 92 | # Win32 needs to close the DLL before it can unlink it, but unfortunately |
91 | 93 | # dl_unload_file was missing on Win32 prior to perl change #24679! |
92 | 94 | if ($^O eq 'MSWin32' and defined &DynaLoader::dl_unload_file) { |