generic: drop Q_CC_MSVC conditionals

This commit is contained in:
Ivailo Monev 2015-09-25 04:08:21 +00:00
parent e31da1d693
commit a9e96a38b0
7 changed files with 5 additions and 34 deletions

View file

@ -279,7 +279,7 @@ private:
#if !defined(KDE_NO_DEBUG_OUTPUT) #if !defined(KDE_NO_DEBUG_OUTPUT)
/* __VA_ARGS__ should work with any supported GCC version and MSVC > 2005 */ /* __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__); \ # define kDebug(...) for (bool _k_kDebugDoOutput_ = !KDebug::hasNullOutputQtDebugMsg(__VA_ARGS__); \
KDE_ISUNLIKELY(_k_kDebugDoOutput_); _k_kDebugDoOutput_ = false) \ KDE_ISUNLIKELY(_k_kDebugDoOutput_); _k_kDebugDoOutput_ = false) \
KDebug(QtDebugMsg, __FILE__, __LINE__, Q_FUNC_INFO)(__VA_ARGS__) KDebug(QtDebugMsg, __FILE__, __LINE__, Q_FUNC_INFO)(__VA_ARGS__)

View file

@ -63,22 +63,12 @@ class KCleanUpGlobalStatic
inline ~KCleanUpGlobalStatic() { func(); } 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 * @internal
* *
* Make the struct of the K_GLOBAL_STATIC anonymous. * Make the struct of the K_GLOBAL_STATIC anonymous.
*/ */
# define K_GLOBAL_STATIC_STRUCT_NAME(NAME) #define K_GLOBAL_STATIC_STRUCT_NAME(NAME)
#endif
/// @endcond /// @endcond

View file

@ -100,10 +100,8 @@ QString findLibraryInternal(const QString &name, const KComponentData &cData)
return libfile; return libfile;
// Now look where they don't belong but sometimes are // Now look where they don't belong but sometimes are
#ifndef Q_CC_MSVC
if (!hasPrefix) if (!hasPrefix)
libname = fileinfo.path() + QLatin1String("/lib") + fileinfo.fileName(); libname = fileinfo.path() + QLatin1String("/lib") + fileinfo.fileName();
#endif
libfile = cData.dirs()->findResource("lib", libname); libfile = cData.dirs()->findResource("lib", libname);
if (!libfile.isEmpty()) { if (!libfile.isEmpty()) {

View file

@ -172,10 +172,4 @@ public:
}; };
#ifdef Q_CC_MSVC
template<class T, class K>
inline uint qHash(const KSortableItem<T,K>&) { Q_ASSERT(0); return 0; }
#endif
#endif // KSORTABLELIST_H #endif // KSORTABLELIST_H

View file

@ -426,13 +426,8 @@
* @sa KDE_BF_ENUM * @sa KDE_BF_ENUM
*/ */
#ifdef Q_CC_MSVC #define KDE_BF_ENUM(a) a
# define KDE_BF_ENUM(a) unsigned int #define KDE_CAST_BF_ENUM(a,b) b
# define KDE_CAST_BF_ENUM(a,b) static_cast<a>(b)
#else
# define KDE_BF_ENUM(a) a
# define KDE_CAST_BF_ENUM(a,b) b
#endif
/** /**
* @def KDE_WEAK_SYMBOL * @def KDE_WEAK_SYMBOL

View file

@ -104,11 +104,9 @@ public:
} }
private: private:
#ifndef Q_CC_MSVC
using Container::iterator::operator*; using Container::iterator::operator*;
using Container::iterator::operator->; using Container::iterator::operator->;
using Container::iterator::value; using Container::iterator::value;
#endif
}; };
typedef _iterator<LeftContainer> left_iterator; typedef _iterator<LeftContainer> left_iterator;

View file

@ -68,11 +68,7 @@ namespace Solid
}; };
} }
#ifdef Q_CC_MSVC #define SOLID_GLOBAL_STATIC_STRUCT_NAME(NAME)
# define SOLID_GLOBAL_STATIC_STRUCT_NAME(NAME) _solid_##NAME##__LINE__
#else
# define SOLID_GLOBAL_STATIC_STRUCT_NAME(NAME)
#endif
#define SOLID_GLOBAL_STATIC(TYPE, NAME) SOLID_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ()) #define SOLID_GLOBAL_STATIC(TYPE, NAME) SOLID_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ())