diff --git a/src/auto/configure b/src/auto/configure --- a/src/auto/configure +++ b/src/auto/configure @@ -9873,7 +9873,7 @@ libc.h sys/statfs.h poll.h sys/poll.h pwd.h \ utime.h sys/param.h libintl.h libgen.h \ util/debug.h util/msg18n.h frame.h sys/acl.h \ - sys/access.h sys/sysinfo.h wchar.h wctype.h + sys/access.h sys/sysinfo.h wchar.h wctype.h limits.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" diff --git a/src/config.h.in b/src/config.h.in --- a/src/config.h.in +++ b/src/config.h.in @@ -232,6 +232,7 @@ #undef HAVE_LIBC_H #undef HAVE_LIBGEN_H #undef HAVE_LIBINTL_H +#undef HAVE_LIMITS_H #undef HAVE_LOCALE_H #undef HAVE_MATH_H #undef HAVE_NDIR_H diff --git a/src/configure.in b/src/configure.in --- a/src/configure.in +++ b/src/configure.in @@ -2883,7 +2883,7 @@ libc.h sys/statfs.h poll.h sys/poll.h pwd.h \ utime.h sys/param.h libintl.h libgen.h \ util/debug.h util/msg18n.h frame.h sys/acl.h \ - sys/access.h sys/sysinfo.h wchar.h wctype.h) + sys/access.h sys/sysinfo.h wchar.h wctype.h limits.h) dnl sys/ptem.h depends on sys/stream.h on Solaris AC_CHECK_HEADERS(sys/ptem.h, [], [], diff --git a/src/vim.h b/src/vim.h --- a/src/vim.h +++ b/src/vim.h @@ -1617,7 +1617,12 @@ typedef int colnr_T; /* column number type */ typedef unsigned short disptick_T; /* display tick type */ -#define MAXLNUM (0x7fffffffL) /* maximum (invalid) line number */ +#ifdef HAVE_LIMITS_H +# include +# define MAXLNUM LONG_MAX +#else +# define MAXLNUM (0x7fffffffL) /* maximum (invalid) line number */ +#endif /* * Well, you won't believe it, but some S/390 machines ("host", now also known