Re: PyDoc_STRVAR error in msvc compile

Discussion in 'Python' started by MRAB, Oct 2, 2013.

  1. MRAB

    MRAB Guest

    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/report...src/rl_addons/renderPM/_renderPM.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.
    MRAB, Oct 2, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robin Becker

    PyDoc_STRVAR error in msvc compile

    Robin Becker, Oct 1, 2013, in forum: Python
    Replies:
    0
    Views:
    121
    Robin Becker
    Oct 1, 2013
  2. MRAB
    Replies:
    0
    Views:
    123
  3. Robin Becker

    Re: PyDoc_STRVAR error in msvc compile

    Robin Becker, Oct 2, 2013, in forum: Python
    Replies:
    0
    Views:
    121
    Robin Becker
    Oct 2, 2013
  4. Robin Becker

    Re: PyDoc_STRVAR error in msvc compile

    Robin Becker, Oct 2, 2013, in forum: Python
    Replies:
    0
    Views:
    120
    Robin Becker
    Oct 2, 2013
  5. Dave Angel

    Re: PyDoc_STRVAR error in msvc compile

    Dave Angel, Oct 2, 2013, in forum: Python
    Replies:
    0
    Views:
    113
    Dave Angel
    Oct 2, 2013
Loading...

Share This Page