summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2019-06-12 15:41:30 +0200
committerSlávek Banko <slavek.banko@axis.cz>2019-06-12 15:42:16 +0200
commitfcb9b0f5fcb390b2aa6f4812539d511e0e9c1671 (patch)
tree51478796ef5140a22ae7b26ffde6c0642347b0ca /src/tools
parentcf5e27248bf530247d38bc1122165513dca431c3 (diff)
downloadqt3-fcb9b0f5fcb390b2aa6f4812539d511e0e9c1671.tar.gz
qt3-fcb9b0f5fcb390b2aa6f4812539d511e0e9c1671.zip
Change tests for glibc version.
It resolves building with libc libraries other than glibc - for example musl libc. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit edad20d4f9ef3de0b91c163361803f12fc7212bc)
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/qdir_unix.cpp8
-rw-r--r--src/tools/qfileinfo_unix.cpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/tools/qdir_unix.cpp b/src/tools/qdir_unix.cpp
index 0b297ca..4021c7f 100644
--- a/src/tools/qdir_unix.cpp
+++ b/src/tools/qdir_unix.cpp
@@ -74,7 +74,7 @@ QString QDir::homeDirPath()
QString QDir::canonicalPath() const
{
QString r;
-#if defined(__GLIBC__) && !defined(PATH_MAX)
+#if !defined(PATH_MAX)
char *cur = ::get_current_dir_name();
if ( cur ) {
char *tmp = canonicalize_file_name( QFile::encodeName( dPath ).data() );
@@ -100,7 +100,7 @@ QString QDir::canonicalPath() const
// always make sure we go back to the current dir
::chdir( cur );
}
-#endif /* __GLIBC__ && !PATH_MAX */
+#endif /* !PATH_MAX */
return r;
}
@@ -162,7 +162,7 @@ QString QDir::currentDirPath()
struct stat st;
if ( ::stat( ".", &st ) == 0 ) {
-#if defined(__GLIBC__) && !defined(PATH_MAX)
+#if !defined(PATH_MAX)
char *currentName = ::get_current_dir_name();
if ( currentName ) {
result = QFile::decodeName(currentName);
@@ -172,7 +172,7 @@ QString QDir::currentDirPath()
char currentName[PATH_MAX+1];
if ( ::getcwd( currentName, PATH_MAX ) )
result = QFile::decodeName(currentName);
-#endif /* __GLIBC__ && !PATH_MAX */
+#endif /* !PATH_MAX */
#if defined(QT_DEBUG)
if ( result.isNull() )
qWarning( "QDir::currentDirPath: getcwd() failed" );
diff --git a/src/tools/qfileinfo_unix.cpp b/src/tools/qfileinfo_unix.cpp
index cddb8f9..0ca0917 100644
--- a/src/tools/qfileinfo_unix.cpp
+++ b/src/tools/qfileinfo_unix.cpp
@@ -133,7 +133,7 @@ QString QFileInfo::readLink() const
if ( !isSymLink() )
return QString();
#if defined(Q_OS_UNIX) && !defined(Q_OS_OS2EMX)
-#if defined(__GLIBC__) && !defined(PATH_MAX)
+#if !defined(PATH_MAX)
int size = 256;
char *s = NULL, *s2;
@@ -165,7 +165,7 @@ QString QFileInfo::readLink() const
s[len] = '\0';
return QFile::decodeName(s);
}
-#endif /* __GLIBC__ && !PATH_MAX */
+#endif /* !PATH_MAX */
#endif /* Q_OS_UNIX && !Q_OS_OS2EMX */
#if !defined(QWS) && defined(Q_OS_MAC)
{