From 002cb50499ca64539d677e46f035a0d62ab981e1 Mon Sep 17 00:00:00 2001 From: Chris Li Date: Thu, 10 Aug 2017 15:34:14 -0400 Subject: [PATCH] switch to gtk3 --- Makefile | 6 +++--- ast-model.c | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 96e81c4..db410eb 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ HAVE_LIBXML:=$(shell $(PKG_CONFIG) --exists libxml-2.0 2>/dev/null && echo 'yes' HAVE_GCC_DEP:=$(shell touch .gcc-test.c && \ $(CC) -c -Wp,-MD,.gcc-test.d .gcc-test.c 2>/dev/null && \ echo 'yes'; rm -f .gcc-test.d .gcc-test.o .gcc-test.c) -HAVE_GTK2:=$(shell $(PKG_CONFIG) --exists gtk+-2.0 2>/dev/null && echo 'yes') +HAVE_GTK2:=$(shell $(PKG_CONFIG) --exists gtk+-3.0 2>/dev/null && echo 'yes') LLVM_CONFIG:=llvm-config HAVE_LLVM:=$(shell $(LLVM_CONFIG) --version >/dev/null 2>&1 && echo 'yes') @@ -67,8 +67,8 @@ $(warning Your system does not have libxml, disabling c2xml) endif ifeq ($(HAVE_GTK2),yes) -GTK2_CFLAGS := $(shell $(PKG_CONFIG) --cflags gtk+-2.0) -GTK2_LIBS := $(shell $(PKG_CONFIG) --libs gtk+-2.0) +GTK2_CFLAGS := $(shell $(PKG_CONFIG) --cflags gtk+-3.0) +GTK2_LIBS := $(shell $(PKG_CONFIG) --libs gtk+-3.0) PROGRAMS += test-inspect INST_PROGRAMS += test-inspect test-inspect_EXTRA_DEPS := ast-model.o ast-view.o ast-inspect.o diff --git a/ast-model.c b/ast-model.c index 704c487..d7f0c3a 100644 --- a/ast-model.c +++ b/ast-model.c @@ -401,7 +401,8 @@ static gint ast_iter_n_children (GtkTreeModel *tree_model, GtkTreeIter *iter) { - AstNode *node = iter->user_data; + AstNode *node = iter ? iter->user_data + : AST_NODE(tree_model); inspect_child_node(node); return node->childnodes->len; -- 2.7.4