Paul Eggert wrote: > Won't this run into a problem when (for > example) private headers include system headers? E.g., > > // module being implemented > #include "my-interface.h" > > // system headers > #include <stdio.h> > > // gnulib and private headers > #include "minmax.h" > #include "private-header.h" > > where private-header.h includes <utility.h> when HAVE_UTILITY_H, and > this happens to be the first inclusion of <utility.h>. (Solaris 10 > <utility.h> defines MIN.)
Yes, this would run into the same problem. However, these constellations are rare because: - Collisions occur mostly with rarely used headers, such as <utility.h>, <sys/ucred.h> or similar. - gnulib headers and private headers normally #include only well-known, POSIX system headers. (1. because of portability, 2. because these rarely used headers rarely define useful types that need to be present in the .h file.) So, often the only references to rarely used headers is through the // system headers section of a .c file. This explains why so few problems occur with this technique in practice. Bruno _______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib