Browse Source

Disable X11 "deprecated declaration" warning

... for GCC >= 4.6 and clang compilers.

This annoying warning exists on X11 (Linux/Unix/macOS) platforms
because we need to use XKeycodeToKeysym() although it is deprecated.
See STR 2913 for discussion and details.
pull/53/head
Albrecht Schlosser 5 years ago
parent
commit
65a798f9a2
  1. 26
      src/Fl_x.cxx

26
src/Fl_x.cxx

@ -1254,14 +1254,36 @@ static long getIncrData(uchar* &data, const XSelectionEvent& selevent, long lowe
return (long)total; return (long)total;
} }
/* Internal function to reduce "deprecated" warnings for XKeycodeToKeysym(). /*
This way we get only one warning. The option to use XkbKeycodeToKeysym() 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. instead would not help much - see STR #2913 for more information.
Update (Jan 31, 2020): 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.
*/ */
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#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) { static KeySym fl_KeycodeToKeysym(Display *d, KeyCode k, unsigned i) {
return XKeycodeToKeysym(d, k, i); return XKeycodeToKeysym(d, k, i);
} }
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5))
#pragma GCC diagnostic pop
#endif
#pragma clang diagnostic push
#if USE_XRANDR #if USE_XRANDR
static void react_to_screen_reconfiguration() { static void react_to_screen_reconfiguration() {
#if USE_XFT #if USE_XFT

Loading…
Cancel
Save