Here is a patch which adds preliminary pre-processor support to xsubpp. There's a few caveats. #line will now be incorrect, since the #includes now occur BEFORE xsubpp gets to them (I wonder if there's a way to disable those directives). As soon as I get better testing done, I'll send this in to whoever is supposed to see it. To invoke, use
xsubpp -preprocess blah
*** xsubpp.old Fri Aug 8 13:18:20 2003
--- xsubpp Fri Aug 8 13:13:23 2003
***************
*** 164,169 ****
--- 164,170 ----
$process_inout = 1, next SWITCH if $flag eq 'inout';
$process_argtypes = 0, next SWITCH if $flag eq 'noargtype
+s';
$process_argtypes = 1, next SWITCH if $flag eq 'argtypes'
+;
+ $preprocess = 1, next SWITCH if $flag eq 'preprocess';
(print "xsubpp version $XSUBPP_version\n"), exit
if $flag eq 'v';
die $usage;
***************
*** 883,889 ****
$text;
}
! open($FH, $filename) or die "cannot open $filename: $!\n";
# Identify the version of xsubpp used
print <<EOM ;
--- 884,895 ----
$text;
}
! if ( $preprocess ) {
! open($FH, "$Config{cpp} $filename |")
! or die "cannot open $Config{cpp} $filename: $!\n";
! } else {
! open($FH, $filename) or die "cannot open $filename: $!\n";
! }
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.