GNOME Bugzilla – Bug 580194
gresolver doesn't build on Solaris
Last modified: 2009-04-26 17:23:50 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));
Created attachment 133331 [details] [review] Fix ginetaddress.c compile on Solaris Can you verify that this patch works?
Yes, the patch works fine.
committed. thanks for the report