[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] #include limts.h for ULONG_MAX

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Tue, 26 Mar 2013 09:46:52 +0000

Joe Swatosh <joe.swatosh_at_gmail.com> writes:

> Thanks Philip and Bert, perhaps this along with Philip's changes?
>
> [[[
> Index: subversion/include/svn_types.h
> ===================================================================
> --- subversion/include/svn_types.h (revision 1460925)
> +++ subversion/include/svn_types.h (working copy)
> @@ -1241,7 +1241,7 @@
> *
> * @since New in 1.7.
> */
> -#define SVN_LINENUM_MAX_VALUE ULONG_MAX
> +#define SVN_LINENUM_MAX_VALUE APR_UINT64_MAX
>
> ]]]

That's not right for two reasons. svn_linenum_t is unsigned long and
that may not be 64 bits; if it's 32 bits we need a 32 bit value. Also
this is a public header file and older APR don't define APR_UINT64_MAX.

I don't see any APR constant that gives us the maximum value for an
unsigned long so I think ULONG_MAX is the only option here. From your
earlier patch it appears you need limits.h for that. What I don't
understand is that svn_types.h includes apr.h and apr.h should include
include limits.h. Does your apr not have

#define APR_HAVE_LIMITS_H 1

/* header files for PATH_MAX, _POSIX_PATH_MAX */
#if APR_HAVE_LIMITS_H
#include <limits.h>
#else
#if APR_HAVE_SYS_SYSLIMITS_H
#include <sys/syslimits.h>
#endif
#endif

-- 
Certified & Supported Apache Subversion Downloads:
http://www.wandisco.com/subversion/download
Received on 2013-03-26 11:47:39 CET

This is an archived mail posted to the Subversion Dev mailing list.