From d3f5dcefe4f51b61efc75edbf82488c006ac181c Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Tue, 16 Jul 2019 10:55:29 +0100 Subject: [PATCH] Fix the libc hook. Friend declarations to `extern "C"` functions must have a forward declaration with the correct signature. --- src/mem/threadalloc.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mem/threadalloc.h b/src/mem/threadalloc.h index 7f284c8..fb92032 100644 --- a/src/mem/threadalloc.h +++ b/src/mem/threadalloc.h @@ -7,6 +7,8 @@ #error At most one out of SNMALLOC_USE_THREAD_CLEANUP and SNMALLOC_USE_THREAD_DESTRUCTOR may be defined. #endif +extern "C" void _malloc_thread_cleanup(); + namespace snmalloc { /** @@ -147,7 +149,7 @@ namespace snmalloc * This function must be allowed to call back into this class to destroy * the state. */ - friend void _malloc_thread_cleanup(); + friend void ::_malloc_thread_cleanup(); }; /**