bug 1288702 suppress all GTK3 deprecated warnings r=glandium

Functions deprecated in GTK3 are often used for compatibility with GTK2
builds.

MozReview-Commit-ID: F220phw3wVO

--HG--
extra : rebase_source : 128e885652b184c5a7916378d9cebb067ab97eb0
This commit is contained in:
Karl Tomlinson 2016-07-27 13:17:00 +12:00
Родитель 6d1ce3ea1a
Коммит 1a85ce6cf7
4 изменённых файлов: 35 добавлений и 9 удалений

Просмотреть файл

@ -1006,10 +1006,7 @@ ContentParent::RecvUngrabPointer(const uint32_t& aTime)
NS_RUNTIMEABORT("This message only makes sense on GTK platforms");
return false;
#else
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
gdk_pointer_ungrab(aTime);
#pragma GCC diagnostic pop
return true;
#endif
}

Просмотреть файл

@ -63,7 +63,7 @@ CAIRO_VERSION=1.10
PANGO_VERSION=1.22.0
GTK2_VERSION=2.18.0
GTK3_VERSION=3.4.0
GDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_4
GDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4
WINDRES_VERSION=2.14.90
W32API_VERSION=3.14
GNOMEUI_VERSION=2.2.0
@ -2725,8 +2725,9 @@ if test "$COMPILE_ENVIRONMENT"; then
MOZ_GTK3_CFLAGS="-I${_topsrcdir}/widget/gtk/compat-gtk3 $MOZ_GTK3_CFLAGS"
TK_CFLAGS=$MOZ_GTK3_CFLAGS
TK_LIBS=$MOZ_GTK3_LIBS
AC_DEFINE_UNQUOTED(GDK_VERSION_MIN_REQUIRED,$GDK_VERSION_MIN_REQUIRED)
AC_DEFINE_UNQUOTED(GDK_VERSION_MAX_ALLOWED,$GDK_VERSION_MIN_REQUIRED)
dnl GDK_VERSION_MIN_REQUIRED is not set here as GDK3 deprecated warnings
dnl are suppressed by widget/gtk/compat-gtk3/gdk/gdkversionmacros.h.
AC_DEFINE_UNQUOTED(GDK_VERSION_MAX_ALLOWED,$GDK_VERSION_MAX_ALLOWED)
GLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32
fi
if test "$MOZ_WIDGET_TOOLKIT" = gtk2; then

Просмотреть файл

@ -0,0 +1,31 @@
#ifndef GDKVERSIONMACROS_WRAPPER_H
#define GDKVERSIONMACROS_WRAPPER_H
/**
* Suppress all GTK3 deprecated warnings as deprecated functions are often
* used for GTK2 compatibility.
*
* GDK_VERSION_MIN_REQUIRED cannot be used to suppress warnings for functions
* deprecated in 3.0, but still needs to be set because gdkversionmacros.h
* asserts that GDK_VERSION_MAX_ALLOWED >= GDK_VERSION_MIN_REQUIRED and
* GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_0.
*
* Setting GDK_DISABLE_DEPRECATION_WARNINGS would also disable
* GDK_UNAVAILABLE() warnings, which are useful.
*/
#define GDK_VERSION_MIN_REQUIRED GDK_VERSION_3_0
#include_next <gdk/gdkversionmacros.h>
/* GDK_AVAILABLE_IN_ALL was introduced in 3.10 */
#ifndef GDK_AVAILABLE_IN_ALL
#define GDK_AVAILABLE_IN_ALL
#endif
#undef GDK_DEPRECATED
#define GDK_DEPRECATED GDK_AVAILABLE_IN_ALL
#undef GDK_DEPRECATED_FOR
#define GDK_DEPRECATED_FOR(f) GDK_AVAILABLE_IN_ALL
#endif /* GDKVERSIONMACROS_WRAPPER_H */

Просмотреть файл

@ -78,9 +78,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk2':
'gtk2drawing.c',
]
else:
# Ignore GTK3 deprecation warnings while much of the code is still used
# with GTK2.
DEFINES['GDK_DISABLE_DEPRECATION_WARNINGS'] = True;
UNIFIED_SOURCES += [
'gtk3drawing.cpp',
'nsApplicationChooser.cpp',