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>
pull/12/head
Slávek Banko 6 years ago
parent 0e74956766
commit 1aa221a2bc
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -77,11 +77,7 @@
#define QT_SIGNAL_ARGS int #define QT_SIGNAL_ARGS int
#define QT_SIGNAL_IGNORE SIG_IGN #define QT_SIGNAL_IGNORE SIG_IGN
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
#define QT_SOCKLEN_T socklen_t #define QT_SOCKLEN_T socklen_t
#else
#define QT_SOCKLEN_T int
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf #define QT_SNPRINTF ::snprintf

@ -77,11 +77,7 @@
#define QT_SIGNAL_ARGS int #define QT_SIGNAL_ARGS int
#define QT_SIGNAL_IGNORE SIG_IGN #define QT_SIGNAL_IGNORE SIG_IGN
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
#define QT_SOCKLEN_T socklen_t #define QT_SOCKLEN_T socklen_t
#else
#define QT_SOCKLEN_T int
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf #define QT_SNPRINTF ::snprintf

@ -77,11 +77,7 @@
#define QT_SIGNAL_ARGS int #define QT_SIGNAL_ARGS int
#define QT_SIGNAL_IGNORE SIG_IGN #define QT_SIGNAL_IGNORE SIG_IGN
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
#define QT_SOCKLEN_T socklen_t #define QT_SOCKLEN_T socklen_t
#else
#define QT_SOCKLEN_T int
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf #define QT_SNPRINTF ::snprintf

@ -70,11 +70,7 @@
#define QT_SIGNAL_ARGS int #define QT_SIGNAL_ARGS int
#define QT_SIGNAL_IGNORE SIG_IGN #define QT_SIGNAL_IGNORE SIG_IGN
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
#define QT_SOCKLEN_T socklen_t #define QT_SOCKLEN_T socklen_t
#else
#define QT_SOCKLEN_T int
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf #define QT_SNPRINTF ::snprintf

@ -77,11 +77,7 @@
#define QT_SIGNAL_ARGS int #define QT_SIGNAL_ARGS int
#define QT_SIGNAL_IGNORE SIG_IGN #define QT_SIGNAL_IGNORE SIG_IGN
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
#define QT_SOCKLEN_T socklen_t #define QT_SOCKLEN_T socklen_t
#else
#define QT_SOCKLEN_T int
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf #define QT_SNPRINTF ::snprintf

@ -77,11 +77,7 @@
#define QT_SIGNAL_ARGS int #define QT_SIGNAL_ARGS int
#define QT_SIGNAL_IGNORE SIG_IGN #define QT_SIGNAL_IGNORE SIG_IGN
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
#define QT_SOCKLEN_T socklen_t #define QT_SOCKLEN_T socklen_t
#else
#define QT_SOCKLEN_T int
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf #define QT_SNPRINTF ::snprintf

@ -77,11 +77,7 @@
#define QT_SIGNAL_ARGS int #define QT_SIGNAL_ARGS int
#define QT_SIGNAL_IGNORE SIG_IGN #define QT_SIGNAL_IGNORE SIG_IGN
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
#define QT_SOCKLEN_T socklen_t #define QT_SOCKLEN_T socklen_t
#else
#define QT_SOCKLEN_T int
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf #define QT_SNPRINTF ::snprintf

@ -77,11 +77,7 @@
#define QT_SIGNAL_ARGS int #define QT_SIGNAL_ARGS int
#define QT_SIGNAL_IGNORE SIG_IGN #define QT_SIGNAL_IGNORE SIG_IGN
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
#define QT_SOCKLEN_T socklen_t #define QT_SOCKLEN_T socklen_t
#else
#define QT_SOCKLEN_T int
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf #define QT_SNPRINTF ::snprintf

@ -80,11 +80,7 @@
#define QT_SIGNAL_ARGS int #define QT_SIGNAL_ARGS int
#define QT_SIGNAL_IGNORE SIG_IGN #define QT_SIGNAL_IGNORE SIG_IGN
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
#define QT_SOCKLEN_T socklen_t #define QT_SOCKLEN_T socklen_t
#else
#define QT_SOCKLEN_T int
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf #define QT_SNPRINTF ::snprintf

@ -77,11 +77,7 @@
#define QT_SIGNAL_ARGS int #define QT_SIGNAL_ARGS int
#define QT_SIGNAL_IGNORE SIG_IGN #define QT_SIGNAL_IGNORE SIG_IGN
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
#define QT_SOCKLEN_T socklen_t #define QT_SOCKLEN_T socklen_t
#else
#define QT_SOCKLEN_T int
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf #define QT_SNPRINTF ::snprintf

@ -77,11 +77,7 @@
#define QT_SIGNAL_ARGS int #define QT_SIGNAL_ARGS int
#define QT_SIGNAL_IGNORE SIG_IGN #define QT_SIGNAL_IGNORE SIG_IGN
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
#define QT_SOCKLEN_T socklen_t #define QT_SOCKLEN_T socklen_t
#else
#define QT_SOCKLEN_T int
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf #define QT_SNPRINTF ::snprintf

@ -76,11 +76,7 @@
#define QT_SIGNAL_ARGS int #define QT_SIGNAL_ARGS int
#define QT_SIGNAL_IGNORE SIG_IGN #define QT_SIGNAL_IGNORE SIG_IGN
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
#define QT_SOCKLEN_T socklen_t #define QT_SOCKLEN_T socklen_t
#else
#define QT_SOCKLEN_T int
#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf #define QT_SNPRINTF ::snprintf

@ -861,15 +861,7 @@ EOF
int main (argc, argv) int argc; char *argv[]; { int main (argc, argv) int argc; char *argv[]; {
#endif #endif
#ifdef __ELF__ #ifdef __ELF__
# ifdef __GLIBC__ printf ("%s-pc-linux-gnu\n", argv[1]);
# if __GLIBC__ >= 2
printf ("%s-pc-linux-gnu\n", argv[1]);
# else
printf ("%s-pc-linux-gnulibc1\n", argv[1]);
# endif
# else
printf ("%s-pc-linux-gnulibc1\n", argv[1]);
# endif
#else #else
printf ("%s-pc-linux-gnuaout\n", argv[1]); printf ("%s-pc-linux-gnuaout\n", argv[1]);
#endif #endif

@ -74,7 +74,7 @@ TQString TQDir::homeDirPath()
TQString TQDir::canonicalPath() const TQString TQDir::canonicalPath() const
{ {
TQString r; TQString r;
#if defined(__GLIBC__) && !defined(PATH_MAX) #if !defined(PATH_MAX)
char *cur = ::get_current_dir_name(); char *cur = ::get_current_dir_name();
if ( cur ) { if ( cur ) {
char *tmp = canonicalize_file_name( TQFile::encodeName( dPath ).data() ); char *tmp = canonicalize_file_name( TQFile::encodeName( dPath ).data() );
@ -103,7 +103,7 @@ TQString TQDir::canonicalPath() const
// FIXME // FIXME
} }
} }
#endif /* __GLIBC__ && !PATH_MAX */ #endif /* !PATH_MAX */
return r; return r;
} }
@ -165,7 +165,7 @@ TQString TQDir::currentDirPath()
struct stat st; struct stat st;
if ( ::stat( ".", &st ) == 0 ) { if ( ::stat( ".", &st ) == 0 ) {
#if defined(__GLIBC__) && !defined(PATH_MAX) #if !defined(PATH_MAX)
char *currentName = ::get_current_dir_name(); char *currentName = ::get_current_dir_name();
if ( currentName ) { if ( currentName ) {
result = TQFile::decodeName(currentName); result = TQFile::decodeName(currentName);
@ -175,7 +175,7 @@ TQString TQDir::currentDirPath()
char currentName[PATH_MAX+1]; char currentName[PATH_MAX+1];
if ( ::getcwd( currentName, PATH_MAX ) ) if ( ::getcwd( currentName, PATH_MAX ) )
result = TQFile::decodeName(currentName); result = TQFile::decodeName(currentName);
#endif /* __GLIBC__ && !PATH_MAX */ #endif /* !PATH_MAX */
#if defined(QT_DEBUG) #if defined(QT_DEBUG)
if ( result.isNull() ) if ( result.isNull() )
tqWarning( "TQDir::currentDirPath: getcwd() failed" ); tqWarning( "TQDir::currentDirPath: getcwd() failed" );

@ -133,7 +133,7 @@ TQString TQFileInfo::readLink() const
if ( !isSymLink() ) if ( !isSymLink() )
return TQString(); return TQString();
#if defined(Q_OS_UNIX) && !defined(Q_OS_OS2EMX) #if defined(Q_OS_UNIX) && !defined(Q_OS_OS2EMX)
#if defined(__GLIBC__) && !defined(PATH_MAX) #if !defined(PATH_MAX)
int size = 256; int size = 256;
char *s = NULL, *s2; char *s = NULL, *s2;
@ -165,7 +165,7 @@ TQString TQFileInfo::readLink() const
s[len] = '\0'; s[len] = '\0';
return TQFile::decodeName(s); return TQFile::decodeName(s);
} }
#endif /* __GLIBC__ && !PATH_MAX */ #endif /* !PATH_MAX */
#endif /* Q_OS_UNIX && !Q_OS_OS2EMX */ #endif /* Q_OS_UNIX && !Q_OS_OS2EMX */
#if !defined(TQWS) && defined(Q_OS_MAC) #if !defined(TQWS) && defined(Q_OS_MAC)
{ {

Loading…
Cancel
Save