[PATCH weston] editor: Fix g_type_init() call

Quentin Glidic sardemff7+wayland at sardemff7.net
Thu Jun 23 19:06:12 UTC 2016


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.

Signed-off-by: Quentin Glidic <sardemff7+git at sardemff7.net>
---

We can also just drop g_type_init() altogether if the GLib version sounds
correct. FTR, Debian stable (Jessie) has GLib 2.42 and oldstable (Wheezy)
has GLib 2.33.

 clients/editor.c   | 4 ++--
 clients/stacking.c | 4 ----
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/clients/editor.c b/clients/editor.c
index e081a5b..02b2d88 100644
--- a/clients/editor.c
+++ b/clients/editor.c
@@ -1511,9 +1511,9 @@ main(int argc, char *argv[])
 
 	memset(&editor, 0, sizeof editor);
 
-#ifdef HAVE_PANGO
+#if ! GLIB_CHECK_VERSION(2,35,1)
 	g_type_init();
-#endif
+#endif /* ! GLIB_CHECK_VERSION(2,35,1) */
 
 	editor.display = display_create(&argc, argv);
 	if (editor.display == NULL) {
diff --git a/clients/stacking.c b/clients/stacking.c
index 6748576..c7ae900 100644
--- a/clients/stacking.c
+++ b/clients/stacking.c
@@ -286,10 +286,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");
-- 
2.9.0



More information about the wayland-devel mailing list