changed to handle different sa_family_t sizes

This commit is contained in:
hyung-hwan 2021-08-10 10:20:54 +00:00
parent a0bd10822a
commit 0ebd75fda8
4 changed files with 26 additions and 5 deletions

5
hio/configure vendored
View File

@ -18741,6 +18741,11 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
cat >>confdefs.h <<_ACEOF
#define HIO_SIZEOF_SA_FAMILY_T ${ac_cv_sizeof_sa_family_t}
_ACEOF
hio_package_version_major="`echo ${PACKAGE_VERSION} | cut -d. -f1`"
hio_package_version_minor="`echo ${PACKAGE_VERSION} | cut -d. -f2`"

View File

@ -739,6 +739,7 @@ AC_DEFINE_UNQUOTED(HIO_SIZEOF_STRUCT_SOCKADDR_UN, ${ac_cv_sizeof_struct_sockaddr
AC_DEFINE_UNQUOTED(HIO_SIZEOF_STRUCT_SOCKADDR_LL, ${ac_cv_sizeof_struct_sockaddr_ll}, [sizeof(struct sockaddr_ll)])
AC_DEFINE_UNQUOTED(HIO_SIZEOF_STRUCT_SOCKADDR_DL, ${ac_cv_sizeof_struct_sockaddr_dl}, [sizeof(struct sockaddr_dl)])
AC_DEFINE_UNQUOTED(HIO_SIZEOF_SOCKLEN_T, ${ac_cv_sizeof_socklen_t}, [sizeof(socklen_t)])
AC_DEFINE_UNQUOTED(HIO_SIZEOF_SA_FAMILY_T, ${ac_cv_sizeof_sa_family_t}, [sizeof(sa_family_t)])
hio_package_version_major="`echo ${PACKAGE_VERSION} | cut -d. -f1`"

View File

@ -633,6 +633,9 @@
/* sizeof(off_t) */
#undef HIO_SIZEOF_OFF_T
/* sizeof(sa_family_t) */
#undef HIO_SIZEOF_SA_FAMILY_T
/* sizeof(short) */
#undef HIO_SIZEOF_SHORT

View File

@ -52,12 +52,24 @@
# define HIO_SIZEOF_SKAD_T HIO_SIZEOF_STRUCT_SOCKADDR_UN
#endif
#if !defined(HIO_AF_UNIX)
#if (HIO_SIZEOF_SA_FAMILY_T == 1) && !defined(HIO_SA_FAMILY_T_IS_SIGNED)
# if !defined(HIO_AF_UNIX)
# define HIO_AF_UNIX (254)
# endif
# define HIO_AF_QX (255)
#elif (HIO_SIZEOF_SA_FAMILY_T == 1) && defined(HIO_SA_FAMILY_T_IS_SIGNED)
# if !defined(HIO_AF_UNIX)
# define HIO_AF_UNIX (-2)
# endif
# define HIO_AF_QX (-1)
#else
# if !defined(HIO_AF_UNIX)
/* this is a fake value */
# define HIO_AF_UNIX (65534)
# endif
/* this is HIO specific. No AF_XXXX definitions must overlap with this */
# define HIO_AF_QX (65530)
#endif
/* this is HIO specific. No AF_XXXX definitions must overlap with this */
#define HIO_AF_QX (65530)
struct hio_skad_t
{