Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #55316 > unrolled thread

Re: PyDoc_STRVAR error in msvc compile

Started byDave Angel <davea@davea.name>
First post2013-10-02 12:05 +0000
Last post2013-10-02 12:05 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: PyDoc_STRVAR error in msvc compile Dave Angel <davea@davea.name> - 2013-10-02 12:05 +0000

#55316 — Re: PyDoc_STRVAR error in msvc compile

FromDave Angel <davea@davea.name>
Date2013-10-02 12:05 +0000
SubjectRe: PyDoc_STRVAR error in msvc compile
Message-ID<mailman.617.1380715526.18130.python-list@python.org>
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
>
> 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.

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".



-- 
DaveA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web