This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository e16-keyedit.

View the commit online.

commit deec3032500de49a12ec9b0bae7adf4a6861ca5b
Author: Kim Woelders <k...@woelders.dk>
AuthorDate: Wed Dec 6 19:13:44 2023 +0100

    Avoid gtk2 deprecation warnings
---
 configure.ac | 17 ++++++-----------
 e16keyedit.h | 13 ++++++++-----
 ipc.c        |  2 --
 menus.c      |  3 ---
 viewer.c     |  2 --
 5 files changed, 14 insertions(+), 23 deletions(-)

diff --git a/configure.ac b/configure.ac
index cae3577..f23cd0b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,20 +24,15 @@ AC_ARG_WITH(gtk,
   [  --with-gtk              Select GTK version to use (auto/gtk2/gtk3) @<:@default=auto@:>@],,
   with_gtk=auto)
 
-test_gtk="$with_gtk"
-if test "x$with_gtk" = "xauto" ; then test_gtk="gtk2"; fi
-
-if test "x$test_gtk" = "xgtk2" ; then
+if test "x$with_gtk" = "xauto" -o "x$with_gtk" = "xgtk2"; then
   AC_MSG_CHECKING([for GTK2]);
-  pkg_modules="gtk+-2.0 >= 2.0.0"
-  PKG_CHECK_MODULES(GTK, [$pkg_modules],,
-		    [if test "x$with_gtk" = "xauto" ; then test_gtk="gtk3"; fi])
-
+  PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.0.0], with_gtk="gtk2"
+    AC_DEFINE(USE_GTK, 2, [Using GTK 2]), no="y")
 fi
-if test "x$test_gtk" = "xgtk3" ; then
+if test "x$with_gtk" = "xauto" -o "x$with_gtk" = "xgtk3"; then
   AC_MSG_CHECKING([for GTK3]);
-  pkg_modules="gtk+-3.0 >= 3.0.0"
-  PKG_CHECK_MODULES(GTK, [$pkg_modules])
+  PKG_CHECK_MODULES(GTK, [gtk+-3.0 >= 3.0.0], with_gtk="gtk3"
+    AC_DEFINE(USE_GTK, 3, [Using GTK 3]), no="y")
 fi
 if test "x$GTK_CFLAGS" = "x" ; then
   AC_MSG_ERROR([GTK 2 or 3 is required.])
diff --git a/e16keyedit.h b/e16keyedit.h
index 3d8bd66..3938a46 100644
--- a/e16keyedit.h
+++ b/e16keyedit.h
@@ -7,16 +7,19 @@
 #define __UNUSED__
 #endif
 
-#if GTK_CHECK_VERSION(3,0,0)
-#define USE_GTK 3
+#pragma GCC diagnostic push
+#if USE_GTK == 2
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#pragma GCC diagnostic ignored "-Wstrict-prototypes"
+#endif
+#include <gtk/gtk.h>
+#pragma GCC diagnostic pop
 
+#if USE_GTK == 3
 #define gtk_hbox_new(homogeneous, spacing) \
     gtk_box_new(GTK_ORIENTATION_HORIZONTAL, spacing)
 #define gtk_vbox_new(homogeneous, spacing) \
     gtk_box_new(GTK_ORIENTATION_VERTICAL, spacing)
-
-#else
-#define USE_GTK 2
 #endif
 
 /* ipc.c */
diff --git a/ipc.c b/ipc.c
index da6daa0..fe08831 100644
--- a/ipc.c
+++ b/ipc.c
@@ -1,7 +1,5 @@
 #include "config.h"
 
-#include <gtk/gtk.h>
-#include <gdk/gdk.h>
 #include <gdk/gdkx.h>
 #include <X11/Xlib.h>
 #include <stdio.h>
diff --git a/menus.c b/menus.c
index a01131c..9a1d4b9 100644
--- a/menus.c
+++ b/menus.c
@@ -5,9 +5,6 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include <gdk/gdkkeysyms.h>
-#include <gtk/gtk.h>
-
 #include "e16keyedit.h"
 
 GtkWidget      *
diff --git a/viewer.c b/viewer.c
index ad4170d..f92fb57 100644
--- a/viewer.c
+++ b/viewer.c
@@ -5,8 +5,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <gdk/gdkx.h>
-#include <gtk/gtk.h>
 
 #include "e16keyedit.h"
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to