-rw-r--r-- | qmake/tools/qgvector.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/qmake/tools/qgvector.cpp b/qmake/tools/qgvector.cpp index 1985f03..3c903ed 100644 --- a/qmake/tools/qgvector.cpp +++ b/qmake/tools/qgvector.cpp | |||
@@ -30,16 +30,22 @@ | |||
30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. | 30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. |
31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
32 | ** | 32 | ** |
33 | ** Contact info@trolltech.com if any conditions of this licensing are | 33 | ** Contact info@trolltech.com if any conditions of this licensing are |
34 | ** not clear to you. | 34 | ** not clear to you. |
35 | ** | 35 | ** |
36 | **********************************************************************/ | 36 | **********************************************************************/ |
37 | 37 | ||
38 | #include "qglobal.h" | ||
39 | #if defined(Q_CC_BOR) | ||
40 | // needed for qsort() because of a std namespace problem on Borland | ||
41 | #include "qplatformdefs.h" | ||
42 | #endif | ||
43 | |||
38 | #define QGVECTOR_CPP | 44 | #define QGVECTOR_CPP |
39 | #include "qgvector.h" | 45 | #include "qgvector.h" |
40 | #include "qglist.h" | 46 | #include "qglist.h" |
41 | #include "qstring.h" | 47 | #include "qstring.h" |
42 | #include "qdatastream.h" | 48 | #include "qdatastream.h" |
43 | #include <stdlib.h> | 49 | #include <stdlib.h> |
44 | 50 | ||
45 | #ifdef QT_THREAD_SUPPORT | 51 | #ifdef QT_THREAD_SUPPORT |
@@ -388,17 +394,18 @@ void QGVector::sort() // sort vector | |||
388 | *start = *end; | 394 | *start = *end; |
389 | *end = tmp; | 395 | *end = tmp; |
390 | } else { | 396 | } else { |
391 | break; | 397 | break; |
392 | } | 398 | } |
393 | } | 399 | } |
394 | 400 | ||
395 | #ifdef QT_THREAD_SUPPORT | 401 | #ifdef QT_THREAD_SUPPORT |
396 | QMutexLocker locker( qt_global_mutexpool->get( &sort_vec ) ); | 402 | QMutexLocker locker( qt_global_mutexpool ? |
403 | qt_global_mutexpool->get( &sort_vec ) : 0 ); | ||
397 | #endif // QT_THREAD_SUPPORT | 404 | #endif // QT_THREAD_SUPPORT |
398 | 405 | ||
399 | sort_vec = (QGVector*)this; | 406 | sort_vec = (QGVector*)this; |
400 | qsort( vec, count(), sizeof(Item), cmp_vec ); | 407 | qsort( vec, count(), sizeof(Item), cmp_vec ); |
401 | sort_vec = 0; | 408 | sort_vec = 0; |
402 | } | 409 | } |
403 | 410 | ||
404 | int QGVector::bsearch( Item d ) const // binary search; when sorted | 411 | int QGVector::bsearch( Item d ) const // binary search; when sorted |