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


Groups > comp.lang.python > #55316

Re: PyDoc_STRVAR error in msvc compile

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:error': 0.03; 'static': 0.04; 'url:bitbucket': 0.05; '(all': 0.07; 'string': 0.09; '#endif': 0.09; 'highlighting': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'seemed': 0.09; 'spaces': 0.09; '#create': 0.16; '#delete': 0.16; '#ifdef': 0.16; 'bitbucket': 0.16; 'conditional': 0.16; 'formatted': 0.16; 'line)': 0.16; 'parameters,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'string\\n': 0.16; 'variations': 0.16; 'vim)': 0.16; 'wrote:': 0.18; 'library': 0.18; 'module': 0.19; 'trying': 0.19; 'properly': 0.19; 'skip:g 40': 0.19; 'url:default': 0.19; 'import': 0.22; 'separate': 0.22; 'header :User-Agent:1': 0.23; 'char': 0.24; 'source': 0.25; 'define': 0.26; 'extension': 0.26; 'header:X-Complaints-To:1': 0.27; 'tried': 0.27; 'correct': 0.29; 'skip:p 30': 0.29; "doesn't": 0.30; 'dos': 0.30; "i'm": 0.30; 'work.': 0.31; 'code': 0.31; 'lines': 0.31; 'that.': 0.31; 'apparently': 0.31; 'font': 0.31; 'interface': 0.32; 'run': 0.32; 'actual': 0.34; 'skip:_ 10': 0.34; 'maybe': 0.34; 'problem.': 0.35; 'editor': 0.35; 'etc': 0.35; 'but': 0.35; 'there': 0.35; 'version': 0.36; "didn't": 0.36; 'charset:us-ascii': 0.36; 'url:org': 0.36; 'too': 0.37; 'skip:m 40': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'use.': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'received:org': 0.40; 'even': 0.60; 'skip:u 10': 0.60; 'simple': 0.61; "you're": 0.61; 'url:c': 0.67; 'legal': 0.71; 'internet': 0.71; 'ending': 0.78; '");': 0.84; '(according': 0.84; 'etc,': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dave Angel <davea@davea.name>
Subject Re: PyDoc_STRVAR error in msvc compile
Date Wed, 2 Oct 2013 12:05:02 +0000 (UTC)
References <524AFB57.9090500@chamonix.reportlab.co.uk> <524B05B7.4060906@mrabarnett.plus.com> <524BE099.8040004@chamonix.reportlab.co.uk> <524BEEFD.50202@chamonix.reportlab.co.uk> <l2gto9$in1$1@ger.gmane.org> <524C035F.6030000@chamonix.reportlab.co.uk>
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host 174.32.174.31
User-Agent XPN/1.2.6 (Street Spirit ; Linux)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.617.1380715526.18130.python-list@python.org> (permalink)
Lines 64
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1380715526 news.xs4all.nl 15947 [2001:888:2000:d::a6]:42142
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:55316

Show key headers only | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web