PyDoc_STRVAR error in msvc compile

Robin Becker robin at reportlab.com
Wed Oct 2 09:46:36 EDT 2013


On 02/10/2013 13:05, Dave Angel wrote:
> On 2/10/2013 07:28, Robin Becker wrote:
>
>
>> The actual is this code from _renderPM.c
>>
>> https://bitbucket.org/rptlab/reportlab/src/fa65fe72b6c2aaecb7747bf14884adb996d8e87f/src/rl_addons/renderPM/_renderPM.c?at=default
>>
........
>> at the end of the lines etc etc.
>
> Unfortunately, bitbucket doesn't properly support highlighting either,
> so I had to copy/paste it into an editor to check for extra spaces.
> That's apparently not your problem.
>
> What I didn't understand before is that PyDoc_STRVAR is a macro, not a
> function.  And inside the macro's parameters, you're trying to define an
> #ifdef.  i don't think Microsoft supports that.
>
> If I'm right, you need to separate out the conditional string
> concatenation from the macro expansion.  it's been too long for me even
> to remember the correct way to do that.  There are some legal tricks you
> can use.  Maybe search the internet for "preprocessor stringizing".
.

that's what I have done; it seems to work OK for MSVC and I'll have to check 
later if it breaks GCC or if I need to do token pasting or something.
-- 
Robin Becker




More information about the Python-list mailing list