To: vim-dev@vim.org Subject: patch 5.5.003 Fcc: outbox From: Bram Moolenaar ------------ Patch 5.5.003 Problem: The autoconf check for sizeof(int) is wrong on machines where sizeof(size_t) != sizeof(int). Solution: Use our own configure check. Also fixes the warning for cross-compiling. Files: src/configure.in, src/configure *** ../vim-5.5.2/src/configure.in Wed Sep 22 10:06:21 1999 --- src/configure.in Tue Sep 21 13:11:49 1999 *************** *** 1174,1182 **** AC_MSG_RESULT(yes); AC_DEFINE(HAVE_RENAME), AC_MSG_RESULT(no)) ! dnl this generates a warning, because the macro from autoconf is wrong. ! dnl just ignore it. ! AC_CHECK_SIZEOF(int) AC_MSG_CHECKING(whether memmove/bcopy/memcpy handle overlaps) [bcopy_test_prog=' --- 1174,1197 ---- AC_MSG_RESULT(yes); AC_DEFINE(HAVE_RENAME), AC_MSG_RESULT(no)) ! dnl Our own version of AC_CHECK_SIZEOF(int); fixes a bug when sizeof() can't ! dnl be printed with "%d", and avoids a warning for cross-compiling. ! ! AC_MSG_CHECKING(size of int) ! AC_CACHE_VAL(ac_cv_sizeof_int, ! [AC_TRY_RUN([#include ! main() ! { ! FILE *f=fopen("conftestval", "w"); ! if (!f) exit(1); ! fprintf(f, "%d\n", (int)sizeof(int)); ! exit(0); ! }], ! ac_cv_sizeof_int=`cat conftestval`, ! ac_cv_sizeof_int=0, ! AC_MSG_ERROR(failed to compile test program))]) ! AC_MSG_RESULT($ac_cv_sizeof_int) ! AC_DEFINE_UNQUOTED(SIZEOF_INT, $ac_cv_sizeof_int) AC_MSG_CHECKING(whether memmove/bcopy/memcpy handle overlaps) [bcopy_test_prog=' *** ../vim-5.5.2/src/configure Wed Sep 22 10:06:21 1999 --- src/configure Tue Sep 21 13:11:51 1999 *************** *** 4841,4867 **** fi rm -f conftest* echo $ac_n "checking size of int""... $ac_c" 1>&6 ! echo "configure:4846: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < ! main() ! { ! FILE *f=fopen("conftestval", "w"); ! if (!f) exit(1); ! fprintf(f, "%d\n", sizeof(int)); ! exit(0); ! } EOF ! if { (eval echo configure:4865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else --- 4841,4868 ---- fi rm -f conftest* + echo $ac_n "checking size of int""... $ac_c" 1>&6 ! echo "configure:4847: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ! { echo "configure: error: failed to compile test program" 1>&2; exit 1; } else cat > conftest.$ac_ext < ! main() ! { ! FILE *f=fopen("conftestval", "w"); ! if (!f) exit(1); ! fprintf(f, "%d\n", (int)sizeof(int)); ! exit(0); ! } EOF ! if { (eval echo configure:4866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else *** ../vim-5.5.2/src/version.c Wed Sep 22 21:12:18 1999 --- src/version.c Wed Sep 22 21:16:59 1999 *************** *** 420,420 **** --- 420,421 ---- { /* Add new patch number below this line */ + 3, -- hundred-and-one symptoms of being an internet addict: 151. You find yourself engaged to someone you've never actually met, except through e-mail. --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\-- \ \ www.vim.org/iccf www.moolenaar.net www.vim.org / /