summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68>2022-01-19 16:53:54 +0000
committerylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68>2022-01-19 16:53:54 +0000
commit46c7859933639f19bc7714c8487a9b3d5a882dc8 (patch)
tree23bb4e872fe879e530878462102ce788293e2331
parent9ad4beb85a6ffa25c85410b1f75524a8906d19c8 (diff)
downloadlibapr-46c7859933639f19bc7714c8487a9b3d5a882dc8.tar.gz
apr_pools: Follow up to r1863234: APR_POOL_DEBUG macros for compat.
To preserve ABI, define apr_pool_{join,find,num_bytes,lock}() as no-op macros in 1.7.x. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1897209 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--include/apr_pools.h22
-rw-r--r--memory/unix/apr_pools.c23
2 files changed, 19 insertions, 26 deletions
diff --git a/include/apr_pools.h b/include/apr_pools.h
index 599ceaf74..88a59ed41 100644
--- a/include/apr_pools.h
+++ b/include/apr_pools.h
@@ -754,12 +754,14 @@ APR_DECLARE(void) apr_pool_cleanup_for_exec(void);
* In this case the caller must call apr_pool_join() to indicate this
* guarantee to the APR_POOL_DEBUG code.
*
- * These functions have an empty implementation if APR is compiled
- * with #APR_POOL_DEBUG not set.
+ * These functions are implemented when #APR_POOL_DEBUG is set and
+ * defined as no-op macros otherwise.
*
* @{
*/
+#if APR_POOL_DEBUG || defined(DOXYGEN)
+
/**
* Guarantee that a subpool has the same lifetime as the parent.
* @param p The parent pool
@@ -791,7 +793,21 @@ APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse)
*/
APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag);
-/** @} */
+#else /* APR_POOL_DEBUG or DOXYGEN */
+
+#undef apr_pool_join
+#define apr_pool_join(a,b)
+
+#undef apr_pool_find
+#define apr_pool_find(mem) (NULL)
+
+#undef apr_pool_num_bytes
+#define apr_pool_num_bytes(p, rec) ((apr_size_t)0)
+
+#undef apr_pool_lock
+#define apr_pool_lock(pool, lock)
+
+#endif /* APR_POOL_DEBUG or DOXYGEN */
/** @} */
diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
index 27d0d528a..e3b84bd28 100644
--- a/memory/unix/apr_pools.c
+++ b/memory/unix/apr_pools.c
@@ -2929,29 +2929,6 @@ APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex_debug(apr_pool_t **newpoo
return apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator);
}
-/*
- * Other stubs, for people who are running
- * mixed release/debug enviroments.
- */
-
-APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub)
-{
-}
-
-APR_DECLARE(apr_pool_t *) apr_pool_find(const void *mem)
-{
- return NULL;
-}
-
-APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *pool, int recurse)
-{
- return 0;
-}
-
-APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag)
-{
-}
-
#else /* APR_POOL_DEBUG */
#undef apr_palloc