0006-Fix-build-with-GCC-11-include-limits.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From 9c56d4da2ff631a8c1c30475bd792f6c86bda53c Mon Sep 17 00:00:00 2001
  2. From: Thiago Macieira <thiago.macieira@intel.com>
  3. Date: Mon, 18 Jan 2021 07:40:54 -0800
  4. Subject: [PATCH] Fix build with GCC 11: include <limits>
  5. Fixes: QTBUG-90395
  6. Pick-to: 6.0
  7. Change-Id: Iecc74d2000eb40dfbe7bfffd165b5dd3708b7a40
  8. Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
  9. [Retrieved (and backported) from:
  10. https://github.com/qt/qtbase/commit/9c56d4da2ff631a8c1c30475bd792f6c86bda53c]
  11. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  12. ---
  13. src/corelib/global/qendian.h | 6 ++++--
  14. src/corelib/global/qfloat16.h | 1 +
  15. 2 files changed, 5 insertions(+), 2 deletions(-)
  16. diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h
  17. index 99b529f17cd..c874c5e47ab 100644
  18. --- a/src/corelib/global/qendian.h
  19. +++ b/src/corelib/global/qendian.h
  20. @@ -1,7 +1,7 @@
  21. /****************************************************************************
  22. **
  23. -** Copyright (C) 2016 The Qt Company Ltd.
  24. -** Copyright (C) 2016 Intel Corporation.
  25. +** Copyright (C) 2021 The Qt Company Ltd.
  26. +** Copyright (C) 2021 Intel Corporation.
  27. ** Contact: https://www.qt.io/licensing/
  28. **
  29. ** This file is part of the QtCore module of the Qt Toolkit.
  30. @@ -44,6 +44,8 @@
  31. #include <QtCore/qfloat16.h>
  32. #include <QtCore/qglobal.h>
  33. +#include <limits>
  34. +
  35. // include stdlib.h and hope that it defines __GLIBC__ for glibc-based systems
  36. #include <stdlib.h>
  37. #include <string.h>
  38. diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h
  39. index e9477d2ecec..a25fac28862 100644
  40. --- a/src/corelib/global/qfloat16.h
  41. +++ b/src/corelib/global/qfloat16.h
  42. @@ -44,6 +44,7 @@
  43. #include <QtCore/qglobal.h>
  44. #include <QtCore/qmetatype.h>
  45. +#include <limits>
  46. #include <string.h>
  47. #if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__AVX2__) && !defined(__F16C__)