g_steal_pointer: make it C++ clean

We have a test that #includes our headers from a C++ program to make
sure we don't throw any errors or warnings as a result of that.

The new inline implementation of g_steal_pointer() does an implicit
conversion from (void *), which is not valid in C++.

Add a cast to avoid the problem.

Thanks to Ignacio Casal Quinteiro for the report.
This commit is contained in:
Ryan Lortie 2015-02-06 17:00:01 +01:00
parent aa68b3d6d6
commit 0110f2a810

View File

@ -183,7 +183,7 @@ gpointer g_try_realloc_n (gpointer mem,
static inline gpointer
(g_steal_pointer) (gpointer pp)
{
gpointer *ptr = pp;
gpointer *ptr = (gpointer *) pp;
gpointer ref;
ref = *ptr;