- Timestamp:
- Dec 11, 2009, 6:51:58 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/corelib/tools/qstring.cpp
r2 r419 60 60 #endif 61 61 62 #ifdef Q_OS_OS2 63 #include "qatomic.h" 64 #include <unidef.h> 65 #endif 66 62 67 #include <private/qfunctions_p.h> 63 68 … … 3331 3336 } 3332 3337 3333 #if ndef Q_WS_MAC3338 #if !defined(Q_WS_MAC) && !defined(Q_OS_OS2) 3334 3339 static QByteArray toLocal8Bit_helper(const QChar *data, int length) 3335 3340 { … … 4569 4574 default: 4570 4575 return 0; 4576 } 4577 #elif defined(Q_OS_OS2) 4578 static QAtomicPointer<void> localeObj; 4579 if (!localeObj) { 4580 LocaleObject lo = 0; 4581 UniCreateLocaleObject(UNI_UCS_STRING_POINTER, (UniChar *)L"", &lo); 4582 if (!localeObj.testAndSetRelaxed(0, lo)) 4583 UniFreeLocaleObject(lo); // we are too late 4584 } 4585 if (localeObj) { 4586 // note: we assume that data1 and data2 are zero-terminated (to avoid 4587 // creation of dumb deep copies) which is at least true for 4.5.1. 4588 #if QT_VERSION == 0x040501 4589 return UniStrcoll(localeObj, (UniChar*)data1, (UniChar *)data2); 4590 #else 4591 # error "Check me!" 4592 #endif 4593 } else { 4594 return ucstrcmp(data1, length1, data2, length2); 4571 4595 } 4572 4596 #elif defined (Q_OS_MAC)
Note:
See TracChangeset
for help on using the changeset viewer.