commit f9ac76a: [Minor] Change macro for C++
Vsevolod Stakhov
vsevolod at rspamd.com
Sat May 28 11:42:04 UTC 2022
Author: Vsevolod Stakhov
Date: 2022-05-28 12:29:44 +0100
URL: https://github.com/rspamd/rspamd/commit/f9ac76aa3c375dfcbd921756e2418384bd4726e6
[Minor] Change macro for C++
---
src/libutil/mem_pool.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/libutil/mem_pool.h b/src/libutil/mem_pool.h
index a9f4fec98..72eb1740d 100644
--- a/src/libutil/mem_pool.h
+++ b/src/libutil/mem_pool.h
@@ -35,6 +35,12 @@
#include <pthread.h>
#endif
+#ifdef __cplusplus
+#define MEMPOOL_STR_FUNC __FUNCTION__
+#else
+#define MEMPOOL_STR_FUNC G_STRFUNC
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -274,7 +280,7 @@ void rspamd_mempool_add_destructor_full (rspamd_mempool_t *pool,
/* Macros for common usage */
#define rspamd_mempool_add_destructor(pool, func, data) \
- rspamd_mempool_add_destructor_full (pool, func, data, (G_STRFUNC), (G_STRLOC))
+ rspamd_mempool_add_destructor_full (pool, func, data, (MEMPOOL_STR_FUNC), (G_STRLOC))
/**
* Replace destructor callback to pool for specified pointer
More information about the Commits
mailing list