Issues with config.h

Robert Kennedy amtor at
Thu Aug 4 13:36:35 UTC 2022

I am working on creating a new port that uses its own config.h.  See attached.  The project compiles and builds just in clang outside of Macports but when it is built via Macports, a number of macro redefined warnings are generated:

./config.h:29:9: warning: 'HAVE_STDINT_H' macro redefined
./config.h:42:9: note: previous definition is here
#define HAVE_STDINT_H 1

I suspect Macports or the compiler is creating or referencing another config.h.

For this project, it looks like the simple solution is to add include guards to config.h.

In my view, It is not good practice to directly include in header files #include <config.h>  or #include "config.h" since this would lead to bad name conflicts etc.

The best solution appears to be outlined here:

But that would involve patching 30 or so source code files.

Has anyone else run into this issue regarding config.h using Macports and what solution did you employ?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config.h.orig
Type: application/octet-stream
Size: 1475 bytes
Desc: config.h.orig
URL: <>

More information about the macports-dev mailing list