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:

e.g.
./config.h:29:9: warning: 'HAVE_STDINT_H' macro redefined
#define HAVE_STDINT_H
        ^
./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:
https://stackoverflow.com/questions/28637542/ensure-config-h-is-included-once

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?

Rob

Attachment: config.h.orig
Description: config.h.orig

Reply via email to