You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2014/02/22 20:00:06 UTC

svn commit: r1570882 - in /subversion/trunk: notes/knobs subversion/include/private/svn_dep_compat.h

Author: stefan2
Date: Sat Feb 22 19:00:05 2014
New Revision: 1570882

URL: http://svn.apache.org/r1570882
Log:
By default, error out when we try to compile SVN with ints shorter
than 32 bits.

Via APR, we use ints to index containers for instance.  We assume that
ints are at least 32 bits such that we can handle large numbers of
changed paths in a revision etc.

* subversion/include/private/svn_dep_compat.h
  (): Check for ints to be 32 bits or wider - if that info is
      available and the check has not been disabled.

* notes/knobs
  (1 Introduction): Fix typo
  (SVN_ALLOW_SHORT_INTS): Document the new compile time option.

Modified:
    subversion/trunk/notes/knobs
    subversion/trunk/subversion/include/private/svn_dep_compat.h

Modified: subversion/trunk/notes/knobs
URL: http://svn.apache.org/viewvc/subversion/trunk/notes/knobs?rev=1570882&r1=1570881&r2=1570882&view=diff
==============================================================================
--- subversion/trunk/notes/knobs (original)
+++ subversion/trunk/notes/knobs Sat Feb 22 19:00:05 2014
@@ -18,13 +18,14 @@ In particular, interface naming rules do
 SVN_* identifiers are not part of the public API unless declared
 as public in some public header file.
 
-The SVN source code boasts a number of enviroment variable or C pre-
+The SVN source code boasts a number of environment variable or C pre-
 processor enabled tweaks that are mainly aimed at developer support.
 If you introduce new ones, please document them here.
 
 Macros documented in the configure-generated ../subversion/svn_private_config.h
 file are not repeated here.
 
+
 2 Defines and Environment Variables
 ===================================
 
@@ -53,6 +54,7 @@ SVN_FS_FS_DELTIFY_PROPS
 SVN_SQLITE_MIN_VERSION_NUMBER
 SVN_SQLITE_MIN_VERSION
 SVN_SERF_NO_LOGGING
+SVN_ALLOW_SHORT_INTS
 
 2.3 Debugging Support
 
@@ -276,6 +278,18 @@ SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2
   Default:   SQLITE_VERSION
   Suggested: not defined (to use default)
 
+4.11 SVN_ALLOW_SHORT_INTS
+
+  Scope:     global
+  Purpose:   Disables the size check for the 'int' type.  We assume ints to
+             be large enough (32 bits) to index various container objects.
+             16 ints will break that assumption.  Defining this option will
+             allow SVN to be compiled even if the size check would fail for
+             some reason.
+  Range:     definedness
+  Default:   not defined
+  Suggested: not defined (to ensure correct behaviour)
+
 
 5 Defines controling debug support
 ==================================

Modified: subversion/trunk/subversion/include/private/svn_dep_compat.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_dep_compat.h?rev=1570882&r1=1570881&r2=1570882&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_dep_compat.h (original)
+++ subversion/trunk/subversion/include/private/svn_dep_compat.h Sat Feb 22 19:00:05 2014
@@ -100,6 +100,18 @@ typedef apr_uint32_t apr_uintptr_t;
 #endif /* !APR_VERSION_AT_LEAST(1,3,0) */
 
 /**
+ * We assume that 'int' and 'unsigned' are at least 32 bits wide.
+ * This also implies that long (rev numbers) is 32 bits or wider.
+ *
+ * @since New in 1.9.
+ */
+#if    defined(APR_HAVE_LIMITS_H) \
+    && !defined(SVN_ALLOW_SHORT_INTS) \
+    && (INT_MAX < 0x7FFFFFFFl)
+#error int is shorter than 32 bits and may break Subversion. Define SVN_ALLOW_SHORT_INTS to skip this check.
+#endif
+
+/**
  * Work around a platform dependency issue. apr_thread_rwlock_trywrlock()
  * will make APR_STATUS_IS_EBUSY() return TRUE if the lock could not be
  * acquired under Unix. Under Windows, this will not work. So, provide