From 631bba964a8b0f58245e5a382cd818628e89598c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 5 Dec 2013 12:51:53 -0800 Subject: Don't use Standard Library routines in qthread_p.h Just write the for loops by hand so we don't need to use the Standard Library. That's necessary to support a -no-stl build. This patch is not necessary in Qt 5 since Qt 5 does not have -no-stl. Task-number: QTBUG-35424 Change-Id: Id449d807eaf7350f1a668ef16d356a9e236c6058 Reviewed-by: Marc Mutz --- src/corelib/thread/qthread_p.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h index 7c9cfc4..2a15847 100644 --- a/src/corelib/thread/qthread_p.h +++ b/src/corelib/thread/qthread_p.h @@ -240,13 +240,21 @@ public: public: FlaggedDebugSignatures() : idx(0) - { std::fill_n(locations, Count, static_cast(0)); } + { + for (uint i = 0; i < Count; ++i) + locations[i] = 0; + } void store(const char* method) { locations[idx++ % Count] = method; } bool contains(const char *method) const - { return std::find(locations, locations + Count, method) != locations + Count; } + { + for (uint i = 0; i < Count; ++i) + if (locations[i] == method) + return true; + return false; + } }; QThread *thread; -- cgit v0.12