GNOME Bugzilla – Bug 516074
NI_MAXHOST and NI_MAXSERV are GNU extensions
Last modified: 2013-09-14 16:50:03 UTC
While chasing down another compilation problem, I learned that the latest glibc release in Fedora Development changes the netdb.h file slightly: -# define NI_MAXHOST 1025 -# define NI_MAXSERV 32 +# ifdef __USE_GNU +# define NI_MAXHOST 1025 +# define NI_MAXSERV 32 +# endif In other words, the constants NI_MAXHOST and NI_MAXSERV in netdb.h are now properly marked as GNU extensions, and their use must be discontinued in code intended to be portable. Unfortunately this change breaks camel-net-utils.[ch].
Created attachment 105074 [details] [review] Proposed patch This works around the problem by defining these constants to match glibc if they're not already defined. Fortunately we don't use them in any public APIs. There are no equivalent constants in POSIX and I believe Solaris defines similar constants with different names, so I think this is the best we can do.
This was introduced in bug 247821 if that helps track down how to best fix it.
*** Bug 515561 has been marked as a duplicate of this bug. ***
(In reply to comment #2) > This was introduced in bug 247821 if that helps track down how to best fix it. Thanks Kjartan.
Matt, seems fine to me.
Committed to trunk (revision 8486).
Post-mortem update: Looks like this may be less of an issue now thanks to http://sourceware.org/bugzilla/show_bug.cgi?id=5737 The patch here is still valid and improves code portability.