Pacify GCC with gdk-pixbuf 2.44

* src/pgtkfns.c (xg_set_icon_from_xpm_data):
* src/xfns.c (xg_set_icon_from_xpm_data):
gdk-pixbuf 2.44 (2025-09) deprecated xg_set_icon_from_xpm_data,
and this breaks --enable-gcc-warnings builds.
For now, pacify GCC by using a pragma.
This commit is contained in:
Paul Eggert 2026-02-13 17:37:50 -08:00
parent e847bcca0c
commit 5d310e0059
2 changed files with 34 additions and 0 deletions

View file

@ -769,8 +769,25 @@ xg_set_icon (struct frame *f, Lisp_Object file)
bool
xg_set_icon_from_xpm_data (struct frame *f, const char **data)
{
/* gdk-pixbuf 2.44 deprecated gdk_pixbuf_new_from_xpm_data.
Emacs should convert assets to PNG and use gdk_pixbuf_new_from_stream
with a GMemoryInputStream, or transition to PNG via GResource.
Pacify GCC for now. */
#if (defined GDK_PIXBUF_VERSION_2_44 \
&& GDK_PIXBUF_VERSION_2_44 <= GDK_PIXBUF_VERSION_MIN_REQUIRED \
&& GNUC_PREREQ (4, 6, 0))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data (data);
#if (defined GDK_PIXBUF_VERSION_2_44 \
&& GDK_PIXBUF_VERSION_2_44 <= GDK_PIXBUF_VERSION_MIN_REQUIRED \
&& GNUC_PREREQ (4, 6, 0))
# pragma GCC diagnostic pop
#endif
if (!pixbuf)
return false;

View file

@ -1146,8 +1146,25 @@ xg_set_icon (struct frame *f, Lisp_Object file)
bool
xg_set_icon_from_xpm_data (struct frame *f, const char **data)
{
/* gdk-pixbuf 2.44 deprecated gdk_pixbuf_new_from_xpm_data.
Emacs should convert assets to PNG and use gdk_pixbuf_new_from_stream
with a GMemoryInputStream, or transition to PNG via GResource.
Pacify GCC for now. */
#if (defined GDK_PIXBUF_VERSION_2_44 \
&& GDK_PIXBUF_VERSION_2_44 <= GDK_PIXBUF_VERSION_MIN_REQUIRED \
&& GNUC_PREREQ (4, 6, 0))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data (data);
#if (defined GDK_PIXBUF_VERSION_2_44 \
&& GDK_PIXBUF_VERSION_2_44 <= GDK_PIXBUF_VERSION_MIN_REQUIRED \
&& GNUC_PREREQ (4, 6, 0))
# pragma GCC diagnostic pop
#endif
if (!pixbuf)
return false;