diff options
author | sjaz <sjaz@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-01-01 12:00:20 +0000 |
---|---|---|
committer | sjaz <sjaz@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-01-01 12:00:20 +0000 |
commit | c777c8d9aa7cd5c2e9a399727a7fa9985a77fb1c (patch) | |
tree | 9e996ae4a1bbb833cec036c5cd4d87a590149e85 /anope.m4 |
Anope Stable Branch
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1902 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'anope.m4')
-rw-r--r-- | anope.m4 | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/anope.m4 b/anope.m4 new file mode 100644 index 000000000..56e750dd3 --- /dev/null +++ b/anope.m4 @@ -0,0 +1,31 @@ +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 +]) |