Skip to content

Commit

Permalink
Added rename qAbs Function for timeval from https://codereview.qt-pro…
Browse files Browse the repository at this point in the history
…ject.org/#change,48831 .

This will fix build on GCC 4.8
Signed-off-by: Davide Bettio <davide.bettio@ispirata.com>
  • Loading branch information
bettio committed Dec 12, 2013
1 parent 6a72160 commit d3ec40b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
23 changes: 23 additions & 0 deletions gcc48_rename_qabs_function_for_timeval.patch
@@ -0,0 +1,23 @@
diff --git a/src/corelib/kernel/qtimerinfo_unix.cpp b/src/corelib/kernel/qtimerinfo_unix.cpp
index 0eee425..7a29247 100644
--- a/src/corelib/kernel/qtimerinfo_unix.cpp
+++ b/src/corelib/kernel/qtimerinfo_unix.cpp
@@ -94,8 +94,7 @@

#if ((_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_MAC) && !defined(Q_OS_INTEGRITY)) || defined(QT_BOOTSTRAPPED)

-template <>
-timeval qAbs(const timeval &t)
+timeval qAbsTimeval(const timeval &t)
{
timeval tmp = t;
if (tmp.tv_sec < 0) {
@@ -144,7 +143,7 @@
timeval tickGranularity;
tickGranularity.tv_sec = 0;
tickGranularity.tv_usec = msPerTick * 1000;
- return elapsedTimeTicks < ((qAbs(*delta) - tickGranularity) * 10);
+ return elapsedTimeTicks < ((qAbsTimeval(*delta) - tickGranularity) * 10);
}

/*
3 changes: 3 additions & 0 deletions qtbase.changes
@@ -1,3 +1,6 @@
* Thu Dec 12 2013 Davide Bettio <davide.bettio@ispirata.com> - 5.0.2
- Added a fix to build Qt 5.0.2 with GCC 4.8 (https://codereview.qt-project.org/#change,48831)

* Mon May 27 2013 Chris Leach <cxl000@hotmail.com> - 5.0.2
- Configure libexec directory to libdir rather than default to datadir

Expand Down
2 changes: 2 additions & 0 deletions qtbase.spec
Expand Up @@ -35,6 +35,7 @@ Patch2: 0002-add-unicode-for-special-characters.patch
Patch3: hackeglfs.patch
Patch4: mtdev.patch
Patch5: bradius.patch
Patch6: gcc48_rename_qabs_function_for_timeval.patch
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(egl)
Expand Down Expand Up @@ -539,6 +540,7 @@ This package contains the Qt5 development defaults package
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1

%build
MAKEFLAGS=%{?_smp_mflags} \
Expand Down

0 comments on commit d3ec40b

Please sign in to comment.