[Pyrex] Putting comments in C code

Anand Patil anand.prabhakar.patil at gmail.com
Thu Dec 6 01:59:26 CET 2007


OK, thanks, I'll give those a shot. If all else fails, I can write a Python
script to find the right line numbers in the C code and insert the pragmas
there. :)

Anand

On Dec 5, 2007 3:28 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:

> Anand Patil wrote:
> > Sorry, I'm trying to place 'pragmas' rather than comments.
>
> You might be able to do something with macros defined in
> a header, and call them from Pyrex as though they were
> functions.
>
> --
> Greg
>


On Dec 5, 2007 2:29 PM, Lenard Lindstrom <len-l at telus.net> wrote:
Probably the only way to introduce pragmas is to place them in a C
header file and include that with a cdef extern from:

cdef extern from "pragmas.h":
   pass

at the top of the module. This will put the #include "pragmas.h" near
the top of the generated C file. I assume that headers are added to the
C file in the order they are encountered in the pyrex code to
accommodate C header dependencies. Put the pragma header in the same
directory as the pyx file.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.copyleft.no/pipermail/pyrex/attachments/20071206/e50d737f/attachment.html 


More information about the Pyrex mailing list