[Pyrex] External declarations and GCC-XML?

Greg Ewing greg at cosc.canterbury.ac.nz
Wed Jul 23 06:59:40 CEST 2003


John J Lee <jjl at pobox.com>:

> On Tue, 22 Jul 2003, Greg Ewing wrote:
> > The real problems
> > mostly concern what to do about #defines, #ifdefs, etc...

> OK, this must obviously be a naive question somehow, but: why doesn't
> running everything through the C preprocessor solve those issues?

Because you don't want to lose the definitions of #defines that are
being used to define a constant or a function-like macro. You want to
turn #defines for constants into an enum declaration, and #defines
for inline functions into a plain function declaration.

On the other hand, #defines that are being used to control #ifdefs
elsewhere in the header you probably do want to process the same
way as the C preprocessor would.

The main problem is how to tell the difference between these
different usages of #define. That's a large part of the
missing information.

Then there are things which can't be translated directly into
Pyrex at all, such as macros which implement polymorphic
functions, or play tricks with the C syntax...

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+




More information about the Pyrex mailing list