summaryrefslogtreecommitdiff
path: root/subversion/include/svn_hash.h
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2018-05-08 03:44:38 +0000
committerPeter Wemm <peter@FreeBSD.org>2018-05-08 03:44:38 +0000
commit3faf8d6bffc5d0fb2525ba37bb504c53366caf9d (patch)
tree7e47911263e75034b767fe34b2f8d3d17e91f66d /subversion/include/svn_hash.h
parenta55fb3c0d5eca7d887798125d5b95942b1f01d4b (diff)
Diffstat (limited to 'subversion/include/svn_hash.h')
-rw-r--r--subversion/include/svn_hash.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/subversion/include/svn_hash.h b/subversion/include/svn_hash.h
index 50ed10a4b3f84..8303f077e18e9 100644
--- a/subversion/include/svn_hash.h
+++ b/subversion/include/svn_hash.h
@@ -239,19 +239,44 @@ svn_hash_from_cstring_keys(apr_hash_t **hash,
const apr_array_header_t *keys,
apr_pool_t *pool);
+/* For the Subversion developers, this #define makes the svn_hash_gets and
+ * svn_hash_sets macros forward their parameters through functions in order to
+ * gain type checking for the 'key' parameter which the basic apr_hash_* APIs
+ * declare only as 'void *'.
+ */
+#ifdef SVN_DEBUG
+#define SVN_HASH__GETS_SETS
+#endif
+
+#ifdef SVN_HASH__GETS_SETS
+void *
+svn_hash__gets_debug(apr_hash_t *ht, const char *key);
+
+#define svn_hash_gets(ht, key) \
+ svn_hash__gets_debug(ht, key)
+#else
/** Shortcut for apr_hash_get() with a const char * key.
*
* @since New in 1.8.
*/
#define svn_hash_gets(ht, key) \
apr_hash_get(ht, key, APR_HASH_KEY_STRING)
+#endif
+
+#ifdef SVN_HASH__GETS_SETS
+void
+svn_hash__sets_debug(apr_hash_t *ht, const char *key, const void *value);
+#define svn_hash_sets(ht, key, val) \
+ svn_hash__sets_debug(ht, key, val)
+#else
/** Shortcut for apr_hash_set() with a const char * key.
*
* @since New in 1.8.
*/
#define svn_hash_sets(ht, key, val) \
apr_hash_set(ht, key, APR_HASH_KEY_STRING, val)
+#endif
/** @} */