mirror of
https://github.com/fltk/fltk.git
synced 2026-06-02 15:46:52 +08:00
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.
This commit is contained in:
+24
-2
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user