Commit 0110f2a8 authored by Allison Karlitskaya's avatar Allison Karlitskaya

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.
parent aa68b3d6
......@@ -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;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment