qskinny/src/common/QskGlobal.h

66 lines
1.5 KiB
C
Raw Normal View History

2017-07-21 16:21:34 +00:00
/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/
#ifndef QSK_GLOBAL_H
#define QSK_GLOBAL_H
#include <qcompilerdetection.h>
2018-08-03 06:15:28 +00:00
#include <qglobal.h>
2017-07-21 16:21:34 +00:00
// QSK_VERSION is (major << 16) + (minor << 8) + patch.
#define QSK_VERSION 0x000001
#define QSK_VERSION_STR "0.0.1"
#ifdef QSK_DLL
#if defined( QSK_MAKEDLL ) // create a DLL library
#define QSK_EXPORT Q_DECL_EXPORT
#else // use a DLL library
#define QSK_EXPORT Q_DECL_IMPORT
#endif
#endif // QSK_DLL
#ifndef QSK_EXPORT
#define QSK_EXPORT
#endif
#define QSK_QT_PRIVATE_BEGIN \
QT_WARNING_PUSH \
QT_WARNING_DISABLE_GCC("-Wpragmas") \
QT_WARNING_DISABLE_GCC("-Wpedantic") \
QT_WARNING_DISABLE_GCC("-Wsuggest-override") \
QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") \
QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods")
#define QSK_QT_PRIVATE_END \
QT_WARNING_POP
2018-08-03 06:15:28 +00:00
#if QT_VERSION >= QT_VERSION_CHECK( 5, 7, 0 )
2017-10-30 13:38:30 +00:00
#define qskAsConst qAsConst
#else
2019-01-04 12:42:16 +00:00
template< typename T >
2018-08-03 06:15:28 +00:00
struct QskAddConst { typedef const T Type; };
2017-10-30 13:38:30 +00:00
2019-01-04 12:42:16 +00:00
template< typename T >
2018-08-03 06:15:28 +00:00
constexpr typename QskAddConst< T >::Type& qskAsConst( T& t ) noexcept { return t; }
2017-10-30 13:38:30 +00:00
2018-08-03 06:15:28 +00:00
template< typename T >
void qskAsConst( const T&& ) = delete;
2017-10-30 13:38:30 +00:00
#endif
2017-12-11 07:58:57 +00:00
#ifdef Q_FALLTHROUGH
#define QSK_FALLTHROUGH Q_FALLTHROUGH
#else
#define QSK_FALLTHROUGH
#endif
2017-07-21 16:21:34 +00:00
#endif