Compare commits

...

5 Commits

Author SHA1 Message Date
OBATA Akio 1e77a5569b
tools: fix to use `pthread_t` for Thread ID
2 years ago
Slávek Banko 38048ca615
Use the tqInstallPath* functions for all paths needed for the pkg-config file.
2 years ago
gregory guy 81c83b98e4
Add a translationsdir variable to the tqt pkgconfig file (tqt-mt.pc).
2 years ago
Ray-V 03d5d59646
Add unicode points so that upper() and lower() functions work for:
2 years ago
Michele Calgaro 300c4d2bd2
Added tqDebug/tqWarning/tqFatal functions that takes a QCString
2 years ago

@ -1546,23 +1546,38 @@ UnixMakefileGenerator::writePkgConfigFile() // ### does make sense only for
project->variables()["ALL_DEPS"].append(fname);
QTextStream t(&ft);
QString prefix = pkgConfigPrefix();
QString libDir = project->first("QMAKE_PKGCONFIG_LIBDIR");
if(libDir.isEmpty())
libDir = prefix + "/lib";
QString includeDir = project->first("QMAKE_PKGCONFIG_INCDIR");
if(includeDir.isEmpty())
includeDir = prefix + "/include";
QString pluginsDir = project->first("QMAKE_PKGCONFIG_PLUGINS");
if(pluginsDir.isEmpty())
pluginsDir = prefix + "/plugins";
t << "prefix=" << prefix << endl;
t << "exec_prefix=${prefix}\n"
<< "libdir=" << pkgConfigFixPath(libDir) << "\n"
<< "includedir=" << pkgConfigFixPath(includeDir) << endl;
// non-standard entry. Provides path for plugins
t << "pluginsdir=" << pkgConfigFixPath(pluginsDir) << endl;
QString prefix = pkgConfigPrefix();
QString libDir = qInstallPathLibs();
if (libDir.isEmpty())
{
libDir = prefix + "/lib";
}
QString includeDir = qInstallPathHeaders();
if (includeDir.isEmpty())
{
includeDir = prefix + "/include";
}
QString pluginsDir = qInstallPathPlugins();
if (pluginsDir.isEmpty())
{
pluginsDir = prefix + "/plugins";
}
QString translationsDir = qInstallPathTranslations();
if (translationsDir.isEmpty())
{
translationsDir = prefix + "/translations";
}
t << "prefix=" << prefix << endl
<< "exec_prefix=${prefix}" << endl
<< "libdir=" << pkgConfigFixPath(libDir) << endl
<< "includedir=" << pkgConfigFixPath(includeDir) << endl
// non-standard entry. Provides path for plugins
<< "pluginsdir=" << pkgConfigFixPath(pluginsDir) << endl
// non-standard entry. Provides path for translations
<< "translationsdir=" << pkgConfigFixPath(translationsDir) << endl
<< endl;
// non-standard entry. Provides useful info normally only
// contained in the internal .qmake.cache file
t << varGlue("CONFIG", "qt_config=", " ", "") << endl << endl;

@ -528,6 +528,11 @@ void qDebug( const char *msg, ... )
handle_buffer(buf, QtDebugMsg);
}
void qDebug( const QCString &s )
{
qDebug(s.data());
}
void qWarning( const QString &msg )
{
char buf[QT_BUFFER_LENGTH];
@ -558,6 +563,11 @@ void qWarning( const char *msg, ... )
handle_buffer(buf, QtWarningMsg);
}
void qWarning( const QCString &s )
{
qWarning(s.data());
}
void qFatal( const QString &msg )
{
char buf[QT_BUFFER_LENGTH];
@ -588,6 +598,11 @@ void qFatal( const char *msg, ... )
handle_buffer(buf, QtFatalMsg);
}
void qFatal( const QCString &s )
{
qWarning(s.data());
}
/*!
\relates QApplication

@ -741,6 +741,7 @@ typedef Q_UINT64 Q_ULLONG; // unsigned long long
// Data stream functions is provided by many classes (defined in qdatastream.h)
//
class QCString;
class QDataStream;
class QString;
@ -958,6 +959,7 @@ Q_EXPORT int qWinVersion();
Q_EXPORT void qDebug( const QString& ); // print debug message
Q_EXPORT void qDebug( const QCString& ); // print debug message
Q_EXPORT void qDebug( const char *, ... ) // print debug message
#if defined(Q_CC_GNU) && !defined(__INSURE__)
__attribute__ ((format (printf, 1, 2)))
@ -965,13 +967,15 @@ Q_EXPORT void qDebug( const char *, ... ) // print debug message
;
Q_EXPORT void qWarning( const QString& ); // print warning message
Q_EXPORT void qWarning( const QCString& ); // print warning message
Q_EXPORT void qWarning( const char *, ... ) // print warning message
#if defined(Q_CC_GNU) && !defined(__INSURE__)
__attribute__ ((format (printf, 1, 2)))
#endif
;
Q_EXPORT void qFatal( const QString& ); // print fatal message and exit
Q_EXPORT void qFatal( const QString& ); // print fatal message and exit
Q_EXPORT void qFatal( const QCString& ); // print fatal message and exit
Q_EXPORT void qFatal( const char *, ... ) // print fatal message and exit
#if defined(Q_CC_GNU)
__attribute__ ((format (printf, 1, 2)))

@ -72,7 +72,6 @@ typedef pthread_mutex_t Q_MUTEX_T;
#include "qmutex_p.h"
#include <errno.h>
#include <stdint.h>
#include <string.h>
// Private class declarations
@ -106,7 +105,8 @@ public:
int level();
int count;
unsigned long owner;
pthread_t owner;
bool is_owned;
pthread_mutex_t handle2;
};
#endif // !Q_RECURSIVE_MUTEX_TYPE
@ -207,7 +207,7 @@ int QRealMutexPrivate::level()
#ifndef Q_RECURSIVE_MUTEX_TYPE
QRecursiveMutexPrivate::QRecursiveMutexPrivate()
: count(0), owner(0)
: count(0), is_owned(false)
{
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
@ -244,14 +244,15 @@ void QRecursiveMutexPrivate::lock()
{
pthread_mutex_lock(&handle2);
if (count > 0 && owner == (unsigned long) pthread_self()) {
if (count > 0 && pthread_equal(owner, pthread_self()) ) {
count++;
} else {
pthread_mutex_unlock(&handle2);
pthread_mutex_lock(&handle);
pthread_mutex_lock(&handle2);
count = 1;
owner = (unsigned long) pthread_self();
owner = pthread_self();
is_owned = true;
}
pthread_mutex_unlock(&handle2);
@ -261,7 +262,7 @@ void QRecursiveMutexPrivate::unlock()
{
pthread_mutex_lock(&handle2);
if (owner == (unsigned long) pthread_self()) {
if ( is_owned && pthread_equal(owner, pthread_self()) ) {
// do nothing if the count is already 0... to reflect the behaviour described
// in the docs
if (count && (--count) < 1) {
@ -271,8 +272,6 @@ void QRecursiveMutexPrivate::unlock()
} else {
#ifdef QT_CHECK_RANGE
qWarning("QMutex::unlock: unlock from different thread than locker");
qWarning(" was locked by %d, unlock attempt from %lu",
(int)owner, (uintptr_t)pthread_self());
#endif
}
@ -309,7 +308,7 @@ bool QRecursiveMutexPrivate::trylock()
pthread_mutex_lock(&handle2);
if ( count > 0 && owner == (unsigned long) pthread_self() ) {
if ( count > 0 && pthread_equal(owner, pthread_self()) ) {
count++;
} else {
int code = pthread_mutex_trylock(&handle);
@ -323,7 +322,8 @@ bool QRecursiveMutexPrivate::trylock()
ret = FALSE;
} else {
count = 1;
owner = (unsigned long) pthread_self();
owner = pthread_self();
is_owned = true;
}
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save