Re: linc-0.1.10 problem building on Solaris 2.6
- From: <dahaverk rockwellcollins com>
- To: michael ximian com
- Cc: orbit-list gnome org
- Subject: Re: linc-0.1.10 problem building on Solaris 2.6
- Date: Fri, 14 Dec 2001 09:53:28 -0600
Michael,
NI_MAXSERV and NI_MAXHOST don't exist in the Solaris /usr/include/netdb.h.
So your fix won't quite do it.
They need to be mapped to something, or have a value set.
-Dave
The only things I found in the Solaris netdb.h file that might be related
were:
#define MAXHOSTNAMELEN 256
#define MAXALIASES 35
#define MAXADDRS 35
When I grep the Solaris System libraries I don't find any defines starting
with " NI_".
Which means NI_NUMERICHOST and NI_NAMEREQD are not defined also.
NI_MAXHOST on Solaris looks like it should be the MAXHOSTNAMELEN value in
the netdb.h
Looking at the linc-protocols.c code it looked like the NI_MAXHOST is the
same as MAXHOSTNAMELEN.
At least on Solaris.... Usage wise in the linc-protocols.c code this
looked reasonable.
Since NI_MAXSERV is used as follows in the code:
gchar tmpport[NI_MAXSERV];
I would infer it is setting a max character string length for a network
address converted to string. So it
seems reasonable to map it to the MAXADDRS in the Solaris netdb.h file.
The other " NI_" defines don't get any compiler warnings so I wouldn't do
anything about them even
though they aren't in the Solaris system includes.
I Added the AF_UNIX check since the other NI_xxxxxx defines show up in the
AF_IRDA and may
require a different mapping. I haven't ever done network programming with
IRDA (Irda on a Sun).
Potential change Something like:
#include <netdb.h>
#if !defined (NI_MAXHOST) && defined(AF_UNIX)
#define NI_MAXHOST MAXHOSTNAMELEN
#endif
#if !defined( NI_MAXSERV ) && defined(AF_UNIX)
#define NI_MAXSERV MAXADDRS
#endif
Ref: _______________________________
Hi Dave,
On Wed, 12 Dec 2001 dahaverk@rockwellcollins.com wrote:
> I've also encountered the following errors in linc that I haven't
> tracked down a fix for yet....
>
> linc-protocols.c: In function `linc_protocol_get_sockinfo_ipv46':
> linc-protocols.c:476: `NI_MAXSERV' undeclared (first use in this
function)
Does this patch help ? of course it's a bit superstitious, we
should prolly just include netdb.h always but hey.
Regards,
Michael.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/linc/ChangeLog,v
retrieving revision 1.84
diff -u -p -u -r1.84 ChangeLog
--- ChangeLog 2001/12/14 10:48:01 1.84
+++ ChangeLog 2001/12/14 10:54:08
@@ -1,3 +1,8 @@
+2001-12-14 Michael Meeks <michael@ximian.com>
+
+ * src/linc-protocols.c: include netdb.h if we're
+ missing some NI_ defines.
+
2001-12-14 David Haverkamp <dahaverk@rockwellcollins.com>
* src/linc-protocols.c: include arpa/nameser.h before
Index: src/linc-protocols.c
===================================================================
RCS file: /cvs/gnome/linc/src/linc-protocols.c,v
retrieving revision 1.33
diff -u -p -u -r1.33 linc-protocols.c
--- src/linc-protocols.c 2001/12/14 10:48:02 1.33
+++ src/linc-protocols.c 2001/12/14 10:54:08
@@ -43,6 +43,10 @@
#include <arpa/nameser.h>
#include <resolv.h>
+#if !defined (NI_MAXSERV) || !defined (NI_MAXHOST)
+#include <netdb.h>
+#endif
+
#include <linc/linc-protocol.h>
#include <linc/linc-connection.h>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]