mirror of
https://github.com/anope/anope.git
synced 2026-06-25 02:26:38 +02:00
dffa3a16fe
git-svn-id: svn://svn.anope.org/anope/trunk@1051 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@775 5417fbe8-f217-4b02-8779-1006273d7864
32 lines
945 B
Plaintext
32 lines
945 B
Plaintext
dnl Macro: anope_CHECK_TYPE_SIZES
|
|
dnl
|
|
dnl Check the size of several types and define a valid int16_t and int32_t.
|
|
dnl
|
|
AC_DEFUN(anope_CHECK_TYPE_SIZES,
|
|
[dnl Check type sizes
|
|
AC_CHECK_SIZEOF(short)
|
|
AC_CHECK_SIZEOF(int)
|
|
AC_CHECK_SIZEOF(long)
|
|
if test "$ac_cv_sizeof_int" = 2 ; then
|
|
AC_CHECK_TYPE(int16_t, int)
|
|
AC_CHECK_TYPE(u_int16_t, unsigned int)
|
|
elif test "$ac_cv_sizeof_short" = 2 ; then
|
|
AC_CHECK_TYPE(int16_t, short)
|
|
AC_CHECK_TYPE(u_int16_t, unsigned short)
|
|
else
|
|
AC_MSG_ERROR([Cannot find a type with size of 16 bits])
|
|
fi
|
|
if test "$ac_cv_sizeof_int" = 4 ; then
|
|
AC_CHECK_TYPE(int32_t, int)
|
|
AC_CHECK_TYPE(u_int32_t, unsigned int)
|
|
elif test "$ac_cv_sizeof_short" = 4 ; then
|
|
AC_CHECK_TYPE(int32_t, short)
|
|
AC_CHECK_TYPE(u_int32_t, unsigned short)
|
|
elif test "$ac_cv_sizeof_long" = 4 ; then
|
|
AC_CHECK_TYPE(int32_t, long)
|
|
AC_CHECK_TYPE(u_int32_t, unsigned long)
|
|
else
|
|
AC_MSG_ERROR([Cannot find a type with size of 32 bits])
|
|
fi
|
|
])
|