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

Re: 1.7.0-beta1 up for testing / signing

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Thu, 21 Jul 2011 16:37:25 +0100

"roderich.schupp_at_googlemail.com" <roderich.schupp_at_googlemail.com>
writes:

> sorry for the late posting. Here are some minor build nits for people
> stuck
> with old versions of APR and Apache.
>
> - subversion/include/private/svn_dep_compat.h, line 72-73:
> APR_UINT64_C and APR_INT64_C don't exist in APR 0.9.x

I see APR_INT64_C, only APR_UINT64_C is missing.

> possible fix (at least for people with a moderately recent C
> compiler):
>
> #define APR_UINT64_MAX UINT64_MAX
> #define APR_INT64_MAX INT64_MAX
>
> - subversion/tests/libsvn_wc/op-depth-test.c, line 121:
> APR_FPROT_OS_DEFAULT doesn't exist in APR 0.9.x
> It was called APR_OS_DEFAULT then (which is still recognized in APR
> 1.4.x).
>
> - subversion/mod_dav_svn/util.c, line 681:
> apr_strtoff doesn't exist in APR 0.9.x
>
> possible fix: use strtol instead

Thanks! Could you verify the following patch:

Index: subversion/mod_dav_svn/util.c
===================================================================
--- subversion/mod_dav_svn/util.c (revision 1149187)
+++ subversion/mod_dav_svn/util.c (working copy)
@@ -37,6 +37,7 @@
 
 #include "dav_svn.h"
 #include "private/svn_fspath.h"
+#include "private/svn_string_private.h"
 
 dav_error *
 dav_svn__new_error(apr_pool_t *pool,
@@ -678,7 +679,7 @@
   content_length_str = apr_table_get(r->headers_in, "Content-Length");
   if (content_length_str)
     {
- if (apr_strtoff(&content_length, content_length_str, &endp, 10)
+ if (svn__strtoff(&content_length, content_length_str, &endp, 10)
           || endp == content_length_str || *endp || content_length < 0)
         {
           ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "Invalid Content-Length");
Index: subversion/include/private/svn_string_private.h
===================================================================
--- subversion/include/private/svn_string_private.h (revision 1149187)
+++ subversion/include/private/svn_string_private.h (working copy)
@@ -53,6 +53,11 @@
  */
 svn_string_t *
 svn_stringbuf__morph_into_string(svn_stringbuf_t *strbuf);
+
+/** Like apr_strtoff but provided here for backward compatibility
+ * with APR 0.9 */
+apr_status_t
+svn__strtoff(apr_off_t *offset, const char *buf, char **end, int base);
 /** @} */
 
 /** @} */
Index: subversion/include/private/svn_dep_compat.h
===================================================================
--- subversion/include/private/svn_dep_compat.h (revision 1149187)
+++ subversion/include/private/svn_dep_compat.h (working copy)
@@ -62,6 +62,11 @@
 #define apr_array_clear(arr) (arr)->nelts = 0
 #endif
 
+#if !APR_VERSION_AT_LEAST(1,0,0)
+#define APR_UINT64_C(val) UINT64_C(val)
+#define APR_FPROT_OS_DEFAULT APR_OS_DEFAULT
+#endif
+
 #if !APR_VERSION_AT_LEAST(1,3,0)
 #define APR_UINT16_MAX 0xFFFFU
 #define APR_INT16_MAX 0x7FFF
Index: subversion/libsvn_subr/svn_string.c
===================================================================
--- subversion/libsvn_subr/svn_string.c (revision 1149187)
+++ subversion/libsvn_subr/svn_string.c (working copy)
@@ -839,3 +839,16 @@
   *n = (int)val;
   return SVN_NO_ERROR;
 }
+
+
+apr_status_t
+svn__strtoff(apr_off_t *offset, const char *buf, char **end, int base)
+{
+#if !APR_VERSION_AT_LEAST(1,0,0)
+ errno = 0;
+ *offset = strtol(buf, end, base);
+ return APR_FROM_OS_ERROR(errno);
+#else
+ return apr_strtoff(offset, buf, end, base);
+#endif
+}
Index: subversion/tests/libsvn_wc/op-depth-test.c
===================================================================
--- subversion/tests/libsvn_wc/op-depth-test.c (revision 1149187)
+++ subversion/tests/libsvn_wc/op-depth-test.c (working copy)
@@ -40,6 +40,7 @@
 
 #include "private/svn_wc_private.h"
 #include "private/svn_sqlite.h"
+#include "private/svn_dep_compat.h"
 #include "../../libsvn_wc/wc.h"
 #include "../../libsvn_wc/wc_db.h"
 #define SVN_WC__I_AM_WC_DB

-- 
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com
Received on 2011-07-21 17:38:19 CEST

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