After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 516074 - NI_MAXHOST and NI_MAXSERV are GNU extensions
NI_MAXHOST and NI_MAXSERV are GNU extensions
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: general
2.22.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
: 515561 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-02-12 18:28 UTC by Matthew Barnes
Modified: 2013-09-14 16:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (1.42 KB, patch)
2008-02-12 18:37 UTC, Matthew Barnes
committed Details | Review

Description Matthew Barnes 2008-02-12 18:28:27 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].
Comment 1 Matthew Barnes 2008-02-12 18:37:30 UTC
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.
Comment 2 Kjartan Maraas 2008-02-13 17:46:42 UTC
This was introduced in bug 247821 if that helps track down how to best fix it.
Comment 3 Kjartan Maraas 2008-02-13 17:49:04 UTC
*** Bug 515561 has been marked as a duplicate of this bug. ***
Comment 4 Matthew Barnes 2008-02-13 18:27:46 UTC
(In reply to comment #2)
> This was introduced in bug 247821 if that helps track down how to best fix it.

Thanks Kjartan.

Comment 5 Srinivasa Ragavan 2008-02-14 16:43:09 UTC
Matt, seems fine to me.
Comment 6 Matthew Barnes 2008-02-14 18:11:42 UTC
Committed to trunk (revision 8486).
Comment 7 Matthew Barnes 2008-02-18 19:23:18 UTC
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.