]> git.notmuchmail.org Git - notmuch/commit
lib: work around talloc_steal usage from C++ code
authorJani Nikula <jani@nikula.org>
Thu, 12 Apr 2012 20:57:39 +0000 (23:57 +0300)
committerDavid Bremner <bremner@debian.org>
Sun, 15 Apr 2012 12:42:15 +0000 (09:42 -0300)
commitde0557477d908be26615e8fda9f5eb62bed68b65
treec71bba24b66206834edf7623019ef0f118de32f1
parentcddc27034687e1c3bc52204314dfa46219b5d6f9
lib: work around talloc_steal usage from C++ code

Implicit typecast from 'void *' to 'T *' is okay in C, but not in
C++. In talloc_steal, an explicit cast is provided for type safety in
some GCC versions. Otherwise, a cast is required. Provide a template
function for this to maintain type safety, and redefine talloc_steal
to use it.

The template must be outside the extern "C" block (NOTMUCH_BEGIN_DECLS
and NOTMUCH_END_DECLS), but keep it within the GCC visibility #pragma.

No functional changes, apart from making the library build with
compilers other than recent GCC.

Signed-off-by: Jani Nikula <jani@nikula.org>
lib/notmuch-private.h