X11: Suppress compiler warnings when using gcc or clang

Suppress warning [-Wdeprecated-declarations] regarding function
  XKeycodeToKeysym()

Backported from master branch.

Update 'CHANGES' for a potential release 1.3.9
This commit is contained in:
Albrecht Schlosser 2022-07-22 17:54:04 +02:00
parent 8b5da69d53
commit 8ae8370dcf
2 changed files with 51 additions and 4 deletions

21
CHANGES
View File

@ -1,3 +1,24 @@
CHANGES IN FLTK 1.3.9 RELEASED: ???
FLTK 1.3.9 is a maintenance release with some fixes and enhancements.
Details:
Albrecht Schlosser:
Backport X11 INCR protocol fixes from 1.4.0 (issue #451)
X11: Suppress compiler warnings when using gcc or clang
ManoloFLTK:
macOS platform: fix for issue #325 Disabling IM disables Greek and Cyrillic layouts
Fix fullscreen window level corner cases on macOS - cont'd
Fix for issue #373 apparent with macOS platform and SDK ≤ 10.13
Fi xfor issue #452: Fl::get_font_name failure on OS-X.
Fix for issue #454 : crash in Fl::get_font_name().
YX:
Fix IME problem (issue #270)
CHANGES IN FLTK 1.3.8 RELEASED: Nov 20 2021
FLTK 1.3.8 is a maintenance release with some fixes and enhancements.

View File

@ -1,7 +1,7 @@
//
// X specific code for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2021 by Bill Spitzak and others.
// Copyright 1998-2022 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@ -1453,14 +1453,40 @@ static long getIncrData(uchar* &data, const XSelectionEvent& selevent, size_t lo
return (long)total;
}
/* Internal function to reduce "deprecated" warnings for XKeycodeToKeysym().
This way we get only one warning. The option to use XkbKeycodeToKeysym()
instead would not help much - see STR #2913 for more information.
/*
Internal function to reduce "deprecated" warnings for XKeycodeToKeysym().
This way we get at most one warning. The option to use XkbKeycodeToKeysym()
instead would not help much - see STR #2913 for more information.
Update (July 22, 2022): disable "deprecated declaration" warnings in
this function for GCC >= 4.6 and clang (all versions) to get rid of
these warnings at least for current GCC and clang compilers.
Note: '#pragma GCC diagnostic push' needs at least GCC 4.6.
*/
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
static KeySym fl_KeycodeToKeysym(Display *d, KeyCode k, unsigned i) {
return XKeycodeToKeysym(d, k, i);
}
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5))
#pragma GCC diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
int fl_handle(const XEvent& thisevent)
{
XEvent xevent = thisevent;