Embedding python in package using autoconf

  • Thread starter Hallvard B Furuseth
  • Start date
H

Hallvard B Furuseth

I want to use Python as an extension language in a package
which uses autoconf. That means its and Python's autoconf
#defines can conflict, so I can't safely #include both
<Python.h> and the package's own include files:-(

Do anyone have a safe way to #include at least <object.h>
without <pyconfig.h>? E.g. copy the files (and <pyport.h>'s
PyAPI_FUNC/PyAPI_DATA) and rename the autoconf macros - and
fail compilation if that wouldn't work?

Currently I have two sets of source files - one set which
only #includes Python.h and one set which only #includes
the package's files.
They communicate through a single .h file with a bunch of
enums for various functions and struct members, and wrapper
functions to use these by their enum value. It has a few
cheats like declaring "struct _object;" (that's PyObject)
to make life simpler, but it's still rather tedious.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top