From a9e96a38b0ebdea030754add1e1df3165019b0ca Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Fri, 25 Sep 2015 04:08:21 +0000 Subject: [PATCH] generic: drop Q_CC_MSVC conditionals --- kdecore/io/kdebug.h | 2 +- kdecore/kernel/kglobal.h | 12 +----------- kdecore/util/kpluginloader.cpp | 2 -- kdecore/util/ksortablelist.h | 6 ------ kdemacros.h.cmake | 9 ++------- kdeui/itemviews/kbihash_p.h | 2 -- solid/solid/soliddefs_p.h | 6 +----- 7 files changed, 5 insertions(+), 34 deletions(-) diff --git a/kdecore/io/kdebug.h b/kdecore/io/kdebug.h index 2698dd53..e06cb4e4 100644 --- a/kdecore/io/kdebug.h +++ b/kdecore/io/kdebug.h @@ -279,7 +279,7 @@ private: #if !defined(KDE_NO_DEBUG_OUTPUT) /* __VA_ARGS__ should work with any supported GCC version and MSVC > 2005 */ -# if defined(Q_CC_GNU) || (defined(Q_CC_MSVC) && _MSC_VER >= 1500) +# if defined(Q_CC_GNU) # define kDebug(...) for (bool _k_kDebugDoOutput_ = !KDebug::hasNullOutputQtDebugMsg(__VA_ARGS__); \ KDE_ISUNLIKELY(_k_kDebugDoOutput_); _k_kDebugDoOutput_ = false) \ KDebug(QtDebugMsg, __FILE__, __LINE__, Q_FUNC_INFO)(__VA_ARGS__) diff --git a/kdecore/kernel/kglobal.h b/kdecore/kernel/kglobal.h index 0d6dc04d..7cc297e3 100644 --- a/kdecore/kernel/kglobal.h +++ b/kdecore/kernel/kglobal.h @@ -63,22 +63,12 @@ class KCleanUpGlobalStatic inline ~KCleanUpGlobalStatic() { func(); } }; -#ifdef Q_CC_MSVC -/** - * @internal - * - * MSVC seems to give anonymous structs the same name which fails at link time. So instead we name - * the struct and hope that by adding the line number to the name it's unique enough to never clash. - */ -# define K_GLOBAL_STATIC_STRUCT_NAME(NAME) _k_##NAME##__LINE__ -#else /** * @internal * * Make the struct of the K_GLOBAL_STATIC anonymous. */ -# define K_GLOBAL_STATIC_STRUCT_NAME(NAME) -#endif +#define K_GLOBAL_STATIC_STRUCT_NAME(NAME) /// @endcond diff --git a/kdecore/util/kpluginloader.cpp b/kdecore/util/kpluginloader.cpp index 0d6a1d1e..5a1a4c38 100644 --- a/kdecore/util/kpluginloader.cpp +++ b/kdecore/util/kpluginloader.cpp @@ -100,10 +100,8 @@ QString findLibraryInternal(const QString &name, const KComponentData &cData) return libfile; // Now look where they don't belong but sometimes are -#ifndef Q_CC_MSVC if (!hasPrefix) libname = fileinfo.path() + QLatin1String("/lib") + fileinfo.fileName(); -#endif libfile = cData.dirs()->findResource("lib", libname); if (!libfile.isEmpty()) { diff --git a/kdecore/util/ksortablelist.h b/kdecore/util/ksortablelist.h index 425792d6..4698389f 100644 --- a/kdecore/util/ksortablelist.h +++ b/kdecore/util/ksortablelist.h @@ -172,10 +172,4 @@ public: }; -#ifdef Q_CC_MSVC -template -inline uint qHash(const KSortableItem&) { Q_ASSERT(0); return 0; } -#endif - - #endif // KSORTABLELIST_H diff --git a/kdemacros.h.cmake b/kdemacros.h.cmake index 5e3f9594..5eed5e8e 100644 --- a/kdemacros.h.cmake +++ b/kdemacros.h.cmake @@ -426,13 +426,8 @@ * @sa KDE_BF_ENUM */ -#ifdef Q_CC_MSVC -# define KDE_BF_ENUM(a) unsigned int -# define KDE_CAST_BF_ENUM(a,b) static_cast(b) -#else -# define KDE_BF_ENUM(a) a -# define KDE_CAST_BF_ENUM(a,b) b -#endif +#define KDE_BF_ENUM(a) a +#define KDE_CAST_BF_ENUM(a,b) b /** * @def KDE_WEAK_SYMBOL diff --git a/kdeui/itemviews/kbihash_p.h b/kdeui/itemviews/kbihash_p.h index bfc10745..aef42196 100644 --- a/kdeui/itemviews/kbihash_p.h +++ b/kdeui/itemviews/kbihash_p.h @@ -104,11 +104,9 @@ public: } private: -#ifndef Q_CC_MSVC using Container::iterator::operator*; using Container::iterator::operator->; using Container::iterator::value; -#endif }; typedef _iterator left_iterator; diff --git a/solid/solid/soliddefs_p.h b/solid/solid/soliddefs_p.h index aee75a2e..f15a2e76 100644 --- a/solid/solid/soliddefs_p.h +++ b/solid/solid/soliddefs_p.h @@ -68,11 +68,7 @@ namespace Solid }; } -#ifdef Q_CC_MSVC -# define SOLID_GLOBAL_STATIC_STRUCT_NAME(NAME) _solid_##NAME##__LINE__ -#else -# define SOLID_GLOBAL_STATIC_STRUCT_NAME(NAME) -#endif +#define SOLID_GLOBAL_STATIC_STRUCT_NAME(NAME) #define SOLID_GLOBAL_STATIC(TYPE, NAME) SOLID_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ())