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 580194 - gresolver doesn't build on Solaris
gresolver doesn't build on Solaris
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other Solaris
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2009-04-25 03:06 UTC by James Andrewartha
Modified: 2009-04-26 17:23 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28


Attachments
Fix ginetaddress.c compile on Solaris (3.63 KB, patch)
2009-04-26 14:05 UTC, Dan Winship
committed Details | Review

Description James Andrewartha 2009-04-25 03:06:23 UTC
Compiling ginetaddress.c fails like this:
gcc -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\"GLib-GIO\" -I.. -I.. -I../glib -I../gmodule -DG_DISABLE_CAST_CHECKS -DG_DISABLE_DEPRECATED -DGIO_COMPILATION -DGIO_MODULE_DIR=\"/space/buildbot/prefix/lib/gio/modules\" -DHAVE_FEN -DG_DISABLE_SINGLE_INCLUDES -D_REENTRANT -D_PTHREADS -g -O2 -Wall -MT ginetaddress.lo -MD -MP -MF .deps/ginetaddress.Tpo -c ginetaddress.c  -fPIC -DPIC -o .libs/ginetaddress.o
ginetaddress.c: In function `g_inet_address_set_property':
ginetaddress.c:114: warning: implicit declaration of function `memcpy'
ginetaddress.c: In function `g_inet_address_get_is_any':
ginetaddress.c:533: error: request for member `_S6_un' in something not a structure or union
ginetaddress.c:533: error: request for member `_S6_un' in something not a structure or union
ginetaddress.c:533: error: request for member `_S6_un' in something not a structure or union
ginetaddress.c:533: error: request for member `_S6_un' in something not a structure or union
ginetaddress.c: In function `g_inet_address_get_is_loopback':
ginetaddress.c:559: error: request for member `_S6_un' in something not a structure or union
ginetaddress.c:559: error: request for member `_S6_un' in something not a structure or union
ginetaddress.c:559: error: request for member `_S6_un' in something not a structure or union
ginetaddress.c:559: error: request for member `_S6_un' in something not a structure or union
ginetaddress.c: In function `g_inet_address_get_is_link_local':
ginetaddress.c:587: error: request for member `_S6_un' in something not a structure or union
ginetaddress.c: In function `g_inet_address_get_is_site_local':
ginetaddress.c:618: error: request for member `_S6_un' in something not a structure or union
ginetaddress.c: In function `g_inet_address_get_is_multicast':
ginetaddress.c:643: error: request for member `_S6_un' in something not a structure or union
ginetaddress.c: In function `g_inet_address_get_is_mc_global':
ginetaddress.c:664: error: request for member `_S6_un' in something not a structure or union
ginetaddress.c: In function `g_inet_address_get_is_mc_link_local':
ginetaddress.c:685: error: request for member `_S6_un' in something not a structure or union
ginetaddress.c: In function `g_inet_address_get_is_mc_node_local':
ginetaddress.c:706: error: request for member `_S6_un' in something not a structure or union
ginetaddress.c: In function `g_inet_address_get_is_mc_org_local':
ginetaddress.c:727: error: request for member `_S6_un' in something not a structure or union
ginetaddress.c: In function `g_inet_address_get_is_mc_site_local':
ginetaddress.c:748: error: request for member `_S6_un' in something not a structure or union

This is due to /usr/include/netinet/in.h which has IN6_IS_ADDR_* macros like:
#define IN6_IS_ADDR_UNSPECIFIED(addr) \
        (((addr)->_S6_un._S6_u32[3] == 0) && \
        ((addr)->_S6_un._S6_u32[2] == 0) && \
        ((addr)->_S6_un._S6_u32[1] == 0) && \
        ((addr)->_S6_un._S6_u32[0] == 0))
vs the Linux /usr/include/netinet/in.h which has macros like
#define IN6_IS_ADDR_UNSPECIFIED(a) \
        (((__const uint32_t *) (a))[0] == 0                                   \
         && ((__const uint32_t *) (a))[1] == 0                                \
         && ((__const uint32_t *) (a))[2] == 0                                \
         && ((__const uint32_t *) (a))[3] == 0)

so line 533 which is 
    return IN6_IS_ADDR_UNSPECIFIED (&address->priv->addr.ipv6.s6_addr);
gets preprocssed to
    return (((&address->priv->addr.ipv6._S6_un._S6_u8)->_S6_un._S6_u32[3] == 0) && ((&address->priv->addr.ipv6._S6_un._S6_u8)->_S6_un._S6_u32[2] == 0) && ((&address->priv->addr.ipv6._S6_un._S6_u8)->_S6_un._S6_u32[1] == 0) && ((&address->priv->addr.ipv6._S6_un._S6_u8)->_S6_un._S6_u32[0] == 0));
Comment 1 Dan Winship 2009-04-26 14:05:08 UTC
Created attachment 133331 [details] [review]
Fix ginetaddress.c compile on Solaris

Can you verify that this patch works?
Comment 2 James Andrewartha 2009-04-26 15:52:24 UTC
Yes, the patch works fine.
Comment 3 Dan Winship 2009-04-26 17:23:50 UTC
committed. thanks for the report