[Pyrex] Problems with 'public' C functions in an extension

Stefan Behnel behnel_ml at gkec.informatik.tu-darmstadt.de
Mon Jul 3 05:39:45 UTC 2006


Hi again,

Stefan Behnel wrote:
> I'm running into a number of problems when trying to declare C functions
> public in a Pyrex extension module. The first problem is that the generated
> header file declares them /before/ all extension types, which lets the C
> compiler complain about undeclared struct's, as these types appear in the
> function arguments:
> 
> In file included from src/lxml/test.c:35:
> src/lxml/etree.h:6: warning: 'struct LxmlNodeBase' declared inside parameter list
> src/lxml/etree.h:6: warning: its scope is only this definition or declaration,
> which is probably not what you want
> 
> But even when I fix that by moving them to the end of the header file by hand,
> I can't manage to use them in an external module. The import fails with an
> unknown symbol (the function name).

Here is a patch that fixes both problems.

Stefan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: public-func.patch
Type: text/x-patch
Size: 3535 bytes
Desc: not available
Url : http://lists.copyleft.no/pipermail/pyrex/attachments/20060703/17745f30/attachment.bin 


More information about the Pyrex mailing list