tools/m4: Add size check comparison macro.

This commit is contained in:
Jason Volk 2023-03-27 16:29:14 -07:00
parent 5303e170d3
commit c7a89fcd89
2 changed files with 9 additions and 1 deletions

View File

@ -1120,7 +1120,7 @@ AC_TYPE_INTPTR_T
AC_TYPE_UINTPTR_T
dnl C standard type sizes on this platform
AC_CHECK_SIZEOF([char])
RB_CHECK_SIZEOF([char], 1)
AC_CHECK_SIZEOF([short])
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([float])

View File

@ -65,3 +65,11 @@ AC_DEFUN([RB_CHK_SYSHEADER],
])
fi
])
AC_DEFUN([RB_CHECK_SIZEOF],
[
AC_CHECK_SIZEOF([$1])
if [[ "${ac_cv_sizeof_$1}" != "$2" ]]; then
AC_MSG_ERROR([sizeof($1) must be $2 not ${ac_cv_sizeof_$1}. Check config.log for compiler error.])
fi
])