I am working on a C library that has SWIG bindings to Python. In my autotools configuration, I am checking the gettimeofday function. I found that I cannot compile the Python part of my project because it conflicts with the pyconfig.h file, which also defines HAVE_GETTIMEOFDAY.
This seems like a very common problem, I was surprised to see that Python config.h contrary to my own. In my project, I keep config.h private --- ie Not installed with make install . I got the impression that this is correct. I found at least one blog post where this opinion is shared.
Is this a bug that Python is conflicting with my config.h ?
Edit: I solved this by adding
AC_DEFINE(Py_PYCONFIG_H,[],[Defined here to avoid conflicts with pyconfig.h])
to my configure.ac . The question still remains, should config.h be open in your project or remain closed, accessible only to implementation files at build time?
Steve source share