diff options
author | Nia Alarie <nia@NetBSD.org> | 2022-11-10 22:31:47 +0100 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-11-11 17:05:30 +0000 |
commit | bccd787a565d3a88673bfc06574c1939f98d8d72 (patch) | |
tree | 184ea6d6cde6f6409bbd3e60c4353bf1aedf611b | |
parent | 696d19d5db7bcb1c1f582c2b1846520e7e0870cb (diff) | |
download | xorg-lib-libX11-bccd787a565d3a88673bfc06574c1939f98d8d72.tar.gz |
Don't use pragma inside a function, it breaks compiling with older GCCs.
XKBBind.c:230: error: #pragma GCC diagnostic not allowed inside functions
Signed-off-by: Thomas Klausner <wiz@gatalith.at>
-rw-r--r-- | src/xkb/XKBBind.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/xkb/XKBBind.c b/src/xkb/XKBBind.c index a63c86ea..467e4198 100644 --- a/src/xkb/XKBBind.c +++ b/src/xkb/XKBBind.c @@ -202,6 +202,14 @@ XkbKeysymToModifiers(Display *dpy, KeySym ks) return mods; } +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + KeySym XLookupKeysym(register XKeyEvent * event, int col) { @@ -211,22 +219,15 @@ XLookupKeysym(register XKeyEvent * event, int col) return _XLookupKeysym(event, col); _XkbCheckPendingRefresh(dpy, dpy->xkb_info); -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#elif defined(__GNUC__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif return XKeycodeToKeysym(dpy, event->keycode, col); +} + #ifdef __clang__ #pragma clang diagnostic pop #elif defined(__GNUC__) #pragma GCC diagnostic pop #endif -} - /* * Not a public entry point -- XkbTranslateKey is an obsolete name * that is preserved here so that functions linked against the old |