0001-Simplify-use-of-__has_include-in-qlogging.cpp.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. 0002-logging-Fix-build-with-uClibc.patch depends on this upstream patch.
  2. Signed-off-by: Fatih Aşıcı <fatih.asici@gmail.com>
  3. From d1d3c36e876464a9bae42565f086ded268ab5118 Mon Sep 17 00:00:00 2001
  4. From: Thiago Macieira <thiago.macieira@intel.com>
  5. Date: Wed, 17 Dec 2014 20:24:04 -0800
  6. Subject: [PATCH] Simplify use of __has_include in qlogging.cpp
  7. Easier to just #define it to 0
  8. Change-Id: Ife99fdca6564077762fa67c6d7a5becaf48655d8
  9. Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
  10. ---
  11. src/corelib/global/qlogging.cpp | 21 +++++++++------------
  12. 1 file changed, 9 insertions(+), 12 deletions(-)
  13. diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
  14. index 0271573..50d35a6 100644
  15. --- a/src/corelib/global/qlogging.cpp
  16. +++ b/src/corelib/global/qlogging.cpp
  17. @@ -72,20 +72,17 @@
  18. # include "private/qcore_unix_p.h"
  19. #endif
  20. -#if !defined QT_NO_REGULAREXPRESSION && !defined(QT_BOOTSTRAPPED)
  21. -#ifdef __has_include
  22. -#if __has_include(<cxxabi.h>) && __has_include(<execinfo.h>)
  23. -#define QLOGGING_HAVE_BACKTRACE
  24. -#endif
  25. -#elif defined(__GLIBCXX__) && defined(__GLIBC__) // (because older version of gcc don't have __has_include)
  26. -#define QLOGGING_HAVE_BACKTRACE
  27. +#ifndef __has_include
  28. +# define __has_include(x) 0
  29. #endif
  30. -#ifdef QLOGGING_HAVE_BACKTRACE
  31. -#include <qregularexpression.h>
  32. -#include <cxxabi.h>
  33. -#include <execinfo.h>
  34. -#endif
  35. +#if !defined QT_NO_REGULAREXPRESSION && !defined(QT_BOOTSTRAPPED)
  36. +# if (defined(__GLIBC__) && defined(__GLIBCXX__)) || (__has_include(<cxxabi.h>) && __has_include(<execinfo.h>))
  37. +# define QLOGGING_HAVE_BACKTRACE
  38. +# include <qregularexpression.h>
  39. +# include <cxxabi.h>
  40. +# include <execinfo.h>
  41. +# endif
  42. #endif
  43. #include <stdio.h>
  44. --
  45. 1.9.1