Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | From 5e6b1051afa3099a02a758b0596236759d70670e Mon Sep 17 00:00:00 2001 |
| 2 | From: Wenzong Fan <wenzong.fan@windriver.com> |
| 3 | Date: Wed, 26 Sep 2012 20:18:08 +0200 |
| 4 | Subject: [PATCH 02/21] qkbdtty_qws: fix build with old kernel headers |
| 5 | |
| 6 | This issue is that with C++ compiler process an old version of kernel |
| 7 | header file, coincidently that file has a variable named 'new': |
| 8 | |
| 9 | * 'embedded/qkbdtty_qws.cpp' include 'linux/vt.h'; |
| 10 | * '/usr/include/linux/vt.h' has below code on SLED-11.x: |
| 11 | + unsigned int new; |
| 12 | |
| 13 | On mostly hosts it has been changed to: new -> newev. |
| 14 | |
| 15 | Upstream-Status: Pending |
| 16 | |
| 17 | Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> |
| 18 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> |
| 19 | --- |
| 20 | src/gui/embedded/qkbdtty_qws.cpp | 12 ++++++++++++ |
| 21 | 1 file changed, 12 insertions(+) |
| 22 | |
| 23 | diff --git a/src/gui/embedded/qkbdtty_qws.cpp b/src/gui/embedded/qkbdtty_qws.cpp |
| 24 | index a46811b..762138f 100644 |
| 25 | --- a/src/gui/embedded/qkbdtty_qws.cpp |
| 26 | +++ b/src/gui/embedded/qkbdtty_qws.cpp |
| 27 | @@ -54,8 +54,20 @@ |
| 28 | |
| 29 | #if defined Q_OS_LINUX |
| 30 | # include <linux/kd.h> |
| 31 | + |
| 32 | +/* Workaround kernel headers using "new" as variable name. The problem |
| 33 | + is specific to SLED-11, other distros use "newev" rather than "new" */ |
| 34 | +#ifdef __cplusplus |
| 35 | +#warning "workaround kernel headers using new as variable name on SLED 11" |
| 36 | +#define new newev |
| 37 | +#endif |
| 38 | + |
| 39 | # include <linux/vt.h> //TODO: move vt handling somewhere else (QLinuxFbScreen?) |
| 40 | |
| 41 | +#ifdef __cplusplus |
| 42 | +#undef new |
| 43 | +#endif |
| 44 | + |
| 45 | # include "qscreen_qws.h" |
| 46 | # include "qwindowsystem_qws.h" |
| 47 | # include "qapplication.h" |
| 48 | -- |
| 49 | 1.8.0 |
| 50 | |