0002-qkbdtty_qws-fix-build-with-old-kernel-headers.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. This issue is that with C++ compiler process an old version of kernel
  6. header file, coincidently that file has a variable named 'new':
  7. * 'embedded/qkbdtty_qws.cpp' include 'linux/vt.h';
  8. * '/usr/include/linux/vt.h' has below code on SLED-11.x:
  9. + unsigned int new;
  10. On mostly hosts it has been changed to: new -> newev.
  11. Upstream-Status: Pending
  12. Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
  13. Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
  14. ---
  15. src/gui/embedded/qkbdtty_qws.cpp | 12 ++++++++++++
  16. 1 file changed, 12 insertions(+)
  17. diff --git a/src/gui/embedded/qkbdtty_qws.cpp b/src/gui/embedded/qkbdtty_qws.cpp
  18. index a46811b..762138f 100644
  19. --- a/src/gui/embedded/qkbdtty_qws.cpp
  20. +++ b/src/gui/embedded/qkbdtty_qws.cpp
  21. @@ -54,8 +54,20 @@
  22. #if defined Q_OS_LINUX
  23. # include <linux/kd.h>
  24. +
  25. +/* Workaround kernel headers using "new" as variable name. The problem
  26. + is specific to SLED-11, other distros use "newev" rather than "new" */
  27. +#ifdef __cplusplus
  28. +#warning "workaround kernel headers using new as variable name on SLED 11"
  29. +#define new newev
  30. +#endif
  31. +
  32. # include <linux/vt.h> //TODO: move vt handling somewhere else (QLinuxFbScreen?)
  33. +#ifdef __cplusplus
  34. +#undef new
  35. +#endif
  36. +
  37. # include "qscreen_qws.h"
  38. # include "qwindowsystem_qws.h"
  39. # include "qapplication.h"
  40. --
  41. 1.8.0