Skip to content

Commit

Permalink
tools/m4: Add size check comparison macro.
Browse files Browse the repository at this point in the history
  • Loading branch information
jevolk committed Mar 29, 2023
1 parent 5303e17 commit c7a89fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
8 changes: 8 additions & 0 deletions tools/m4/ratbox.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
])

0 comments on commit c7a89fc

Please sign in to comment.