[PATCH weston v2] editor: Drop g_type_init() call

Quentin Glidic sardemff7+wayland at sardemff7.net
Sun Jan 15 12:26:21 UTC 2017


From: Quentin Glidic <sardemff7+git at sardemff7.net>

HAVE_PANGO is not in any AC_DEFINE(), so the check is just wrong.
g_type_init() was never called, which is fine since GLib 2.36 anyway.
It is better not to have a wrong usage of HAVE_PANGO here.
Just check for GLib 2.36 in configure.ac instead.

Signed-off-by: Quentin Glidic <sardemff7+git at sardemff7.net>
---
 clients/editor.c   | 4 ----
 clients/stacking.c | 4 ----
 configure.ac       | 2 +-
 3 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/clients/editor.c b/clients/editor.c
index 42c7f52d..f1dffe1f 100644
--- a/clients/editor.c
+++ b/clients/editor.c
@@ -1604,10 +1604,6 @@ main(int argc, char *argv[])
 
 	memset(&editor, 0, sizeof editor);
 
-#ifdef HAVE_PANGO
-	g_type_init();
-#endif
-
 	editor.display = display_create(&argc, argv);
 	if (editor.display == NULL) {
 		fprintf(stderr, "failed to create display: %m\n");
diff --git a/clients/stacking.c b/clients/stacking.c
index 0682e60a..b034cf2a 100644
--- a/clients/stacking.c
+++ b/clients/stacking.c
@@ -288,10 +288,6 @@ main(int argc, char *argv[])
 
 	memset(&stacking, 0, sizeof stacking);
 
-#ifdef HAVE_PANGO
-	g_type_init();
-#endif
-
 	stacking.display = display_create(&argc, argv);
 	if (stacking.display == NULL) {
 		fprintf(stderr, "Failed to create display: %m\n");
diff --git a/configure.ac b/configure.ac
index 247aa696..aca3b862 100644
--- a/configure.ac
+++ b/configure.ac
@@ -436,7 +436,7 @@ if test x$enable_clients = xyes; then
 	  [AC_ERROR([cairo-egl not used because $CAIRO_EGL_PKG_ERRORS])])],
   [have_cairo_egl=no])
 
-  PKG_CHECK_MODULES(PANGO, [pangocairo], [have_pango=yes], [have_pango=no])
+  PKG_CHECK_MODULES(PANGO, [pangocairo pango glib >= 2.36], [have_pango=yes], [have_pango=no])
 fi
 
 AC_ARG_ENABLE(resize-optimization,
-- 
2.11.0



More information about the wayland-devel mailing list