Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: PyDoc_STRVAR error in msvc compile

Reply
Thread Tools

Re: PyDoc_STRVAR error in msvc compile

 
 
MRAB
Guest
Posts: n/a
 
      10-02-2013
On 02/10/2013 12:28, Robin Becker wrote:
> On 02/10/2013 11:49, Dave Angel wrote:
>>> conditional string or "" then MSVC 9 seems to be ok with it.
>>> >

>> MSVC and other compilers do not not see eye to eye on the preprocessor
>> semantics. I no longer use MSVC so I can't experiment. I can only try
>> to recall extensive manipulation two decades ago.
>>
>> I believe it does the logic of "backslash at the end of line" first. So
>> if there are any spaces or tabs after those backslashes (which might
>> have been lost when you pasted it here), fix them first.
>>
>> Then I think it looks for macro definitions, where the # must be the
>> first non-whitespace of the line. Then it expands such macros, and I
>> think MSVC is unusual in that it expands them multiple times, so a macro
>> expansion can result in another macro invocation.
>>
>> I'm not sure where quotes fit in here.
>>
>> Your original message code doesn't match the expansion you show with -E,
>> so i suspect your "..." eliding hid something significant.

>
> The actual is this code from _renderPM.c
>
> https://bitbucket.org/rptlab/reportl...M.c?at=default
>
> PyDoc_STRVAR(__DOC__,
> "Helper extension module for renderPM.\n\
> \n\
> Interface summary:\n\
> \n\
> import _renderPM\n\
> gstate(width,height[,depth=3,bg=0xffffff]) #create an initialised
> graphics state\n\
> makeT1Font(fontName,pfbPath,names[,reader]) #make a T1 font\n\
> delCache() #delete all T1 font info\n\
> pil2pict(cols,rows,datastr,palette) hreturn PICT version of im as bytes\n"
> #ifdef RENDERPM_FT
> " ft_get_face(fontName) --> ft_face instance\n"
> #endif
> "\n\
> _libart_version # base library version string\n\
> _version # module version string\n\
> ");
>
> when I run that through the pre-processor I get (all on a single line)
>
>
> static char __DOC__[] = "Helper extension module for renderPM.\n\nInterface
> summary:\n\n import _renderPM\n gstate(width,height[,depth=3,bg=0xffffff])
> #create an initialised graphics state\n
> makeT1Font(fontName,pfbPath,names[,reader]) #make a T1 font\n delCache() #delete
> all T1 font info\n pil2pict(cols,rows,datastr,palette) hreturn PICT version of
> im as bytes\n" #ifdef 1 " ft_get_face(fontName) --> ft_face instance\n"
> #endif "\n _libart_version # base library version string\n _version # module
> version string\n";
>
>
>
> I tried a couple of variations of \ at the end of the line preceding #ifdef etc
> etc, but nothing seemed to work. The source is properly DOS formatted (according
> to vim) so it's not a simple line ending issue and I don't have any extra spaces
> at the end of the lines etc etc.
>

I overlooked that PyDoc_STRVAR is a macro, so, no, it doesn't work for
me either.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: PyDoc_STRVAR error in msvc compile Dave Angel Python 0 10-02-2013 10:49 AM
Re: PyDoc_STRVAR error in msvc compile Robin Becker Python 0 10-02-2013 10:01 AM
Re: PyDoc_STRVAR error in msvc compile Robin Becker Python 0 10-02-2013 09:00 AM
Re: PyDoc_STRVAR error in msvc compile MRAB Python 0 10-01-2013 05:26 PM
PyDoc_STRVAR error in msvc compile Robin Becker Python 0 10-01-2013 04:41 PM



Advertisments