develooper Front page | perl.perl5.porters | Postings from August 2016

[perl #129035] XS compiler generates C #line comments forINCLUDE_COMMAND that Visual Studio compiler does not understand

Thread Previous | Thread Next
From:
bubnikv .
Date:
August 21, 2016 21:48
Subject:
[perl #129035] XS compiler generates C #line comments forINCLUDE_COMMAND that Visual Studio compiler does not understand
Message ID:
rt-4.0.24-14099-1471798110-277.129035-75-0@perl.org
# New Ticket Created by  bubnikv . 
# Please include the string:  [perl #129035]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=129035 >


Hello.

I am trying to set up a development perl environment compiled from scratch
with Visual Studio 2013 free C/C++ compiler. I stumbled over a following
problem:

If the XS file contains an INCLUDE_COMMAND call, this line is later stored
as a comment into the generated XS.c file in a form of #line NUMBER
"filepath". Here the "filepath" will be the complete parameter of
INCLUDE_COMMAND. If the parameter contains escaped quotes, this breaks the
__FILE__ substitution in the visual studio C++ compiler.

Here is an example of a #line inserted into XS.c, which the Visual Studio
C++ has a problem with:

#line 112 "c:\\\\wperl64d\\\\bin\\\\perl.exe -MExtUtils::XSpp::Cmd -e xspp
-- -t \"D:/src-perl/Slic3r/xs/xsp/typemap.xspt\"
 \"D:/src-perl/Slic3r/xs/xsp/Print.xsp\""

If I remove the quotes from the INCLUDE_COMMAND call, the resulting form is
swallowed by the Visual Studio compiler without any problem.

#line 112 "c:\\\\wperl64d\\\\bin\\\\perl.exe -MExtUtils::XSpp::Cmd -e xspp
-- -t D:/src-perl/Slic3r/xs/xsp/typemap.xspt
 D:/src-perl/Slic3r/xs/xsp/Print.xsp"

I see the following ways to fix this problem:

1) The XS generator would remove the inner quotes from the #line comments
when targeting the Visual Studio compiler

2) The XS generator would save the intermediate file generated by the
script in  INCLUDE_COMMAND, and reference it in XS.c

Thanks for consideration,
Vojtech


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About