Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to compile since glib 2.56 #13

Open
jo-so opened this issue Jan 20, 2019 · 1 comment
Open

Fails to compile since glib 2.56 #13

jo-so opened this issue Jan 20, 2019 · 1 comment

Comments

@jo-so
Copy link

jo-so commented Jan 20, 2019

% make
cc -fPIC -rdynamic -g -c -Wall -Wextra `pkg-config --cflags gobject-2.0` -DHAVE_LIBUNWIND gobject-list.c
In file included from /usr/include/glib-2.0/gobject/gbinding.h:29,
                 from /usr/include/glib-2.0/glib-object.h:23,
                 from gobject-list.c:25:
/usr/include/glib-2.0/gobject/gobject.h:512:34: error: expected identifier or ‘(’ before ‘__typeof__’
 #define g_object_ref(Obj)      ((__typeof__(Obj)) (g_object_ref) (Obj))
                                  ^~~~~~~~~~
gobject-list.c:405:1: note: in expansion of macro ‘g_object_ref’
 g_object_ref (gpointer object)
 ^~~~~~~~~~~~
/usr/include/glib-2.0/gobject/gobject.h:512:51: error: expected ‘)’ before ‘(’ token
 #define g_object_ref(Obj)      ((__typeof__(Obj)) (g_object_ref) (Obj))
                                                   ^
gobject-list.c:405:1: note: in expansion of macro ‘g_object_ref’
 g_object_ref (gpointer object)
 ^~~~~~~~~~~~
make: *** [Makefile:22: gobject-list.o] Fehler 1

from /usr/include/glib-2.0/gobject/gobject.h:

#if defined(g_has_typeof) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_56
/* Make reference APIs type safe with macros */
#define g_object_ref(Obj)      ((__typeof__(Obj)) (g_object_ref) (Obj))
#define g_object_ref_sink(Obj) ((__typeof__(Obj)) (g_object_ref_sink) (Obj))
#endif
@danni
Copy link
Owner

danni commented Jan 21, 2019

I haven't done much GObject development in recent years, I'd be happy to take a pull request.

Prince781 added a commit to Prince781/gobject-list that referenced this issue Feb 7, 2020
Fixes compilation with latest GLib
Prince781 added a commit to Prince781/gobject-list that referenced this issue Feb 12, 2020
Fixes compilation with latest GLib
danni added a commit that referenced this issue Feb 12, 2020
undef g_object_ref from glib-object.h (#13)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants