From 89277e10682c76403321968af2dbe3f6e44409c8 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Mon, 2 Dec 2013 11:00:07 +0100 Subject: Add operator!=() for timespec structs. This is not an attempt to complete this API, but rather preventing code like !(a==b) being used every time timespec structs are compared for unequality. Change-Id: I0edf3fd3c44a9350208adc6b3fb5fe8aec370a45 Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira --- src/corelib/kernel/qcore_unix_p.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h index 8c0589fdc6..7ab632d7a0 100644 --- a/src/corelib/kernel/qcore_unix_p.h +++ b/src/corelib/kernel/qcore_unix_p.h @@ -117,6 +117,8 @@ inline bool operator<(const timespec &t1, const timespec &t2) { return t1.tv_sec < t2.tv_sec || (t1.tv_sec == t2.tv_sec && t1.tv_nsec < t2.tv_nsec); } inline bool operator==(const timespec &t1, const timespec &t2) { return t1.tv_sec == t2.tv_sec && t1.tv_nsec == t2.tv_nsec; } +inline bool operator!=(const timespec &t1, const timespec &t2) +{ return !(t1 == t2); } inline timespec &operator+=(timespec &t1, const timespec &t2) { t1.tv_sec += t2.tv_sec; -- cgit v1.2.3