From b0f058a4fc1e1b9a163702bf9d7e24f3c80bb507 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Thu, 18 Feb 2021 18:03:31 +0200 Subject: [PATCH] generic: make use of Katie's OS definitions Signed-off-by: Ivailo Monev --- .../samba/filepropertiesplugin/model.cpp | 2 +- kfloppy/debug.h | 6 ++++-- kmix/backends/kmix-backends.cpp | 19 ++++--------------- kmix/backends/mixer_oss.cpp | 2 +- kompare/libkomparediff2/kompareprocess.cpp | 2 +- 5 files changed, 11 insertions(+), 20 deletions(-) diff --git a/kdenetwork-filesharing/samba/filepropertiesplugin/model.cpp b/kdenetwork-filesharing/samba/filepropertiesplugin/model.cpp index 2accd9fd..6e660f5b 100644 --- a/kdenetwork-filesharing/samba/filepropertiesplugin/model.cpp +++ b/kdenetwork-filesharing/samba/filepropertiesplugin/model.cpp @@ -52,7 +52,7 @@ QStringList UserPermissionModel::getUsersList() const unsigned int defminuid; unsigned int defmaxuid; -#ifdef __linux__ +#ifdef Q_OS_LINUX struct stat st; if (!stat("/etc/debian_version", &st)) { /* debian */ defminuid = 1000; diff --git a/kfloppy/debug.h b/kfloppy/debug.h index fdc4cdde..774f786b 100644 --- a/kfloppy/debug.h +++ b/kfloppy/debug.h @@ -24,6 +24,8 @@ #ifndef DEBUG_H #define DEBUG_H +#include + /** * \file debug.h * @@ -51,10 +53,10 @@ // to one known kind. // // -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#if defined(Q_OS_FREEBSD) || defined(Q_OS_DRAGONFLY) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD) #define ANY_BSD (1) #else -#if defined(linux) || defined(LINUX) || defined (__linux) || defined(__linux__) +#if defined(Q_OS_LINUX) #define ANY_LINUX (1) #endif #endif diff --git a/kmix/backends/kmix-backends.cpp b/kmix/backends/kmix-backends.cpp index 35a14a54..c88c20d4 100644 --- a/kmix/backends/kmix-backends.cpp +++ b/kmix/backends/kmix-backends.cpp @@ -29,23 +29,12 @@ -#if defined(sun) || defined(__sun__) +#if defined(Q_OS_SOLARIS) #define SUN_MIXER -#endif - -#ifdef __linux__ - +#elif defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_DRAGONFLY) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD) #define OSS_MIXER #endif -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(_UNIXWARE) -#define OSS_MIXER -#endif - -#if defined(hpux) -#error "The HP/UX port is not maintained anymore, an no official part of KMix / KDE at this point of time! Please contact the current KMix maintainer if you would like to maintain the port." -#endif // hpux - // PORTING: add #ifdef PLATFORM , commands , #endif, add your new mixer below // Compiled by its own! @@ -59,12 +48,12 @@ #if defined(OSS_MIXER) #include "backends/mixer_oss.cpp" -#if !defined(__NetBSD__) && !defined(__OpenBSD__) +#if !defined(Q_OS_NETBSD) && !defined(Q_OS_OPENBSD) #include #else #include #endif -#if !defined(__FreeBSD__) && (SOUND_VERSION >= 0x040000) +#if !defined(Q_OS_FREEBSD) && (SOUND_VERSION >= 0x040000) #define OSS4_MIXER #endif #endif diff --git a/kmix/backends/mixer_oss.cpp b/kmix/backends/mixer_oss.cpp index 9cf23c9e..acd3c2c0 100644 --- a/kmix/backends/mixer_oss.cpp +++ b/kmix/backends/mixer_oss.cpp @@ -31,7 +31,7 @@ #include // Since we're guaranteed an OSS setup here, let's make life easier -#if !defined(__NetBSD__) && !defined(__OpenBSD__) +#if !defined(Q_OS_NETBSD) && !defined(Q_OS_OPENBSD) #include #else #include diff --git a/kompare/libkomparediff2/kompareprocess.cpp b/kompare/libkomparediff2/kompareprocess.cpp index b2057ab1..a916236c 100644 --- a/kompare/libkomparediff2/kompareprocess.cpp +++ b/kompare/libkomparediff2/kompareprocess.cpp @@ -133,7 +133,7 @@ void KompareProcess::writeCommandLine() if ( m_diffSettings->m_largeFiles // default diff does not have -H on OpenBSD // so don't pass this option unless the user overrode the default program -#if defined(__OpenBSD__) +#if defined(Q_OS_OPENBSD) && !m_diffSettings->m_diffProgram.isEmpty() #endif ) -- 2.11.0