diff --git a/src/myx/base/config.cpp b/src/myx/base/config.cpp index 6a7852b..ada0f9c 100644 --- a/src/myx/base/config.cpp +++ b/src/myx/base/config.cpp @@ -1 +1,5 @@ +#ifndef MYXLIB_BUILD_LIBRARIES +#error Define MYXLIB_BUILD_LIBRARIES to compile this file. +#endif + #include "config.hpp" diff --git a/src/myx/base/config.hpp b/src/myx/base/config.hpp index d90a0ef..bd755ae 100644 --- a/src/myx/base/config.hpp +++ b/src/myx/base/config.hpp @@ -5,8 +5,10 @@ #ifdef MYXLIB_BUILD_LIBRARIES #undef MYXLIB_HEADER_ONLY +#define MYXLIB_INLINE inline #else #define MYXLIB_HEADER_ONLY +#define MYXLIB_INLINE inline #endif #ifdef MYXLIB_HEADER_ONLY diff --git a/src/myx/base/enum_bitmask_operations.hpp b/src/myx/base/enum_bitmask_operations.hpp index 896a952..12a8d56 100644 --- a/src/myx/base/enum_bitmask_operations.hpp +++ b/src/myx/base/enum_bitmask_operations.hpp @@ -1,7 +1,6 @@ #ifndef MYX_BASE_ENUM_BITWISE_OPERATIONS_HPP_ #define MYX_BASE_ENUM_BITWISE_OPERATIONS_HPP_ - #pragma once #include diff --git a/src/myx/filesystem/current_executable-inl.hpp b/src/myx/filesystem/current_executable-inl.hpp index 2e8925d..d392375 100644 --- a/src/myx/filesystem/current_executable-inl.hpp +++ b/src/myx/filesystem/current_executable-inl.hpp @@ -22,14 +22,14 @@ namespace filesystem { error "Class CurrentExecutable is supported only in Linux" #endif -CurrentExecutable::CurrentExecutable() : +MYXLIB_INLINE CurrentExecutable::CurrentExecutable() : m_procFilePath( QStringLiteral( "/proc/self/exe" ) ) { m_canonicalFilePath = m_procFilePath.canonicalFilePath(); } -const QFileInfo& CurrentExecutable::canonicalFilePath() const +MYXLIB_INLINE const QFileInfo& CurrentExecutable::canonicalFilePath() const { return( m_canonicalFilePath ); } diff --git a/src/myx/filesystem/current_executable.cpp b/src/myx/filesystem/current_executable.cpp index 53c42a4..2c53d35 100644 --- a/src/myx/filesystem/current_executable.cpp +++ b/src/myx/filesystem/current_executable.cpp @@ -1 +1,5 @@ +#ifndef MYXLIB_BUILD_LIBRARIES +#error Define MYXLIB_BUILD_LIBRARIES to compile this file. +#endif + #include diff --git a/src/myx/filesystem/paths-inl.hpp b/src/myx/filesystem/paths-inl.hpp index f6a54df..b499598 100644 --- a/src/myx/filesystem/paths-inl.hpp +++ b/src/myx/filesystem/paths-inl.hpp @@ -19,9 +19,9 @@ namespace myx { namespace filesystem { -Paths::Paths() = default; +MYXLIB_INLINE Paths::Paths() = default; -Paths::HierarchyType Paths::getHierarchyType() +MYXLIB_INLINE Paths::HierarchyType Paths::getHierarchyType() { QRegExp binUnityRegexp( "/s*bin/unity$" ); QRegExp binRegexp( "/s*bin$" ); @@ -170,7 +170,7 @@ Paths::HierarchyType Paths::getHierarchyType() } // Paths::getHierarchyType -bool Paths::init( const QString& projectDir, const QString& configFileExtension ) +MYXLIB_INLINE bool Paths::init( const QString& projectDir, const QString& configFileExtension ) { m_projectName = projectDir.isEmpty() ? m_currentExecutable.m_canonicalFilePath.fileName() : projectDir; @@ -214,7 +214,7 @@ bool Paths::init( const QString& projectDir, const QString& configFileExtension } // Paths::updatePaths -bool Paths::makeDefaultDirectories() +MYXLIB_INLINE bool Paths::makeDefaultDirectories() { bool status = true; @@ -226,7 +226,7 @@ bool Paths::makeDefaultDirectories() } -QString Paths::findConfigFile( const QString& defaultConfigFile ) +MYXLIB_INLINE QString Paths::findConfigFile( const QString& defaultConfigFile ) { if ( !defaultConfigFile.isEmpty() && QFileInfo( defaultConfigFile ).isReadable() ) { @@ -251,103 +251,103 @@ QString Paths::findConfigFile( const QString& defaultConfigFile ) } // Paths::findConfigFile -QDir Paths::executableFileDirectory() const +MYXLIB_INLINE QDir Paths::executableFileDirectory() const { return( m_currentExecutable.m_canonicalFilePath.dir() ); } -const QDir& Paths::userConfigDirectory() const +MYXLIB_INLINE const QDir& Paths::userConfigDirectory() const { return( m_userConfigDirectory ); } -const QDir& Paths::systemConfigDirectory() const +MYXLIB_INLINE const QDir& Paths::systemConfigDirectory() const { return( m_systemConfigDirectory ); } -const QFileInfo& Paths::configFilePath() const +MYXLIB_INLINE const QFileInfo& Paths::configFilePath() const { return( m_configFilePath ); } -const QString& Paths::configFileName() const +MYXLIB_INLINE const QString& Paths::configFileName() const { return( m_configFileName ); } -const QString& Paths::configFileExtension() const +MYXLIB_INLINE const QString& Paths::configFileExtension() const { return( m_configFileExtension ); } -const QDir& Paths::userVarDataDirectory() const +MYXLIB_INLINE const QDir& Paths::userVarDataDirectory() const { return( m_userVarDataDirectory ); } -const QDir& Paths::systemVarDataDirectory() const +MYXLIB_INLINE const QDir& Paths::systemVarDataDirectory() const { return( m_systemVarDataDirectory ); } -const QDir& Paths::userConstDataDirectory() const +MYXLIB_INLINE const QDir& Paths::userConstDataDirectory() const { return( m_userConstDataDirectory ); } -const QDir& Paths::systemConstDataDirectory() const +MYXLIB_INLINE const QDir& Paths::systemConstDataDirectory() const { return( m_systemConstDataDirectory ); } -const QDir& Paths::userLogDirectory() const +MYXLIB_INLINE const QDir& Paths::userLogDirectory() const { return( m_userLogDirectory ); } -const QDir& Paths::systemLogDirectory() const +MYXLIB_INLINE const QDir& Paths::systemLogDirectory() const { return( m_systemLogDirectory ); } -const QDir& Paths::tempDirectory() const +MYXLIB_INLINE const QDir& Paths::tempDirectory() const { return( m_tempDirectory ); } -const QDir& Paths::homeDirectory() const +MYXLIB_INLINE const QDir& Paths::homeDirectory() const { return( m_homeDirectory ); } -const QString& Paths::projectName() const +MYXLIB_INLINE const QString& Paths::projectName() const { return( m_projectName ); } -QString Paths::executableFileName() const +MYXLIB_INLINE QString Paths::executableFileName() const { return( m_currentExecutable.m_canonicalFilePath.fileName() ); } -const QFileInfo& Paths::executableFilePath() const +MYXLIB_INLINE const QFileInfo& Paths::executableFilePath() const { return( m_currentExecutable.m_canonicalFilePath ); } diff --git a/src/myx/filesystem/paths.cpp b/src/myx/filesystem/paths.cpp index cbe3512..5401d28 100644 --- a/src/myx/filesystem/paths.cpp +++ b/src/myx/filesystem/paths.cpp @@ -1 +1,5 @@ +#ifndef MYXLIB_BUILD_LIBRARIES +#error Define MYXLIB_BUILD_LIBRARIES to compile this file. +#endif + #include diff --git a/src/myx/filesystem/paths_mt-inl.hpp b/src/myx/filesystem/paths_mt-inl.hpp index 999e42f..5cd6897 100644 --- a/src/myx/filesystem/paths_mt-inl.hpp +++ b/src/myx/filesystem/paths_mt-inl.hpp @@ -19,9 +19,9 @@ namespace myx { namespace filesystem { -PathsMT::PathsMT() = default; +MYXLIB_INLINE PathsMT::PathsMT() = default; -PathsMT& PathsMT::instance() +MYXLIB_INLINE PathsMT& PathsMT::instance() { volatile PathsMT* localInstance = mInstance.load( std::memory_order_acquire ); if ( localInstance == nullptr ) diff --git a/src/myx/filesystem/paths_mt.cpp b/src/myx/filesystem/paths_mt.cpp index d093dae..4f13001 100644 --- a/src/myx/filesystem/paths_mt.cpp +++ b/src/myx/filesystem/paths_mt.cpp @@ -1 +1,5 @@ +#ifndef MYXLIB_BUILD_LIBRARIES +#error Define MYXLIB_BUILD_LIBRARIES to compile this file. +#endif + #include diff --git a/src/myx/math/all.hpp b/src/myx/math/all.hpp index 5fbba9c..061532d 100644 --- a/src/myx/math/all.hpp +++ b/src/myx/math/all.hpp @@ -1,3 +1,8 @@ +#ifndef MYX_MATH_ALL_HPP_ +#define MYX_MATH_ALL_HPP_ + +#pragma once + #include #include #include @@ -6,3 +11,5 @@ #include #include #include + +#endif diff --git a/src/myx/math/almost_equal_relative-inl.hpp b/src/myx/math/almost_equal_relative-inl.hpp index fa2a225..ab41af9 100644 --- a/src/myx/math/almost_equal_relative-inl.hpp +++ b/src/myx/math/almost_equal_relative-inl.hpp @@ -1,3 +1,8 @@ +#ifndef MYX_MATH_ALMOST_EQUAL_RELATIVE_INL_HPP_ +#define MYX_MATH_ALMOST_EQUAL_RELATIVE_INL_HPP_ + +#pragma once + #ifndef MYXLIB_HEADER_ONLY #include #endif @@ -8,7 +13,7 @@ namespace myx { namespace math { -bool almost_equal_relative( const float a, const float b, +MYXLIB_INLINE bool almost_equal_relative( const float a, const float b, const float maxRelDiff ) { float diff = fabsf( a - b ); @@ -24,7 +29,7 @@ bool almost_equal_relative( const float a, const float b, } -bool almost_equal_relative( const double a, const double b, +MYXLIB_INLINE bool almost_equal_relative( const double a, const double b, const double maxRelDiff ) { double diff = fabs( a - b ); @@ -42,3 +47,5 @@ bool almost_equal_relative( const double a, const double b, } // namespace math } // namespace myx + +#endif diff --git a/src/myx/math/almost_equal_relative.cpp b/src/myx/math/almost_equal_relative.cpp index bc79e13..4b2770b 100644 --- a/src/myx/math/almost_equal_relative.cpp +++ b/src/myx/math/almost_equal_relative.cpp @@ -1 +1,5 @@ +#ifndef MYXLIB_BUILD_LIBRARIES +#error Define MYXLIB_BUILD_LIBRARIES to compile this file. +#endif + #include diff --git a/src/myx/math/almost_equal_relative.hpp b/src/myx/math/almost_equal_relative.hpp index 3fd15ae..a16926c 100644 --- a/src/myx/math/almost_equal_relative.hpp +++ b/src/myx/math/almost_equal_relative.hpp @@ -1,6 +1,8 @@ #ifndef MYX_MATH_ALMOST_EQUAL_RELATIVE_HPP_ #define MYX_MATH_ALMOST_EQUAL_RELATIVE_HPP_ +#pragma once + #include #include diff --git a/src/myx/math/almost_equal_relative_and_abs-inl.hpp b/src/myx/math/almost_equal_relative_and_abs-inl.hpp index 79981f4..a3eb720 100644 --- a/src/myx/math/almost_equal_relative_and_abs-inl.hpp +++ b/src/myx/math/almost_equal_relative_and_abs-inl.hpp @@ -1,3 +1,8 @@ +#ifndef MYX_MATH_ALMOST_EQUAL_RELATIVE_AND_ABS_INL_HPP_ +#define MYX_MATH_ALMOST_EQUAL_RELATIVE_AND_ABS_INL_HPP_ + +#pragma once + #ifndef MYXLIB_HEADER_ONLY #include #endif @@ -8,7 +13,7 @@ namespace myx { namespace math { -bool almost_equal_relative_and_abs( const float a, const float b, +MYXLIB_INLINE bool almost_equal_relative_and_abs( const float a, const float b, const float maxAbsDiff, const float maxRelDiff ) { // Check if the numbers are really close -- needed @@ -31,7 +36,7 @@ bool almost_equal_relative_and_abs( const float a, const float b, } -bool almost_equal_relative_and_abs( const double a, const double b, +MYXLIB_INLINE bool almost_equal_relative_and_abs( const double a, const double b, const double maxAbsDiff, const double maxRelDiff ) { // Check if the numbers are really close -- needed @@ -56,3 +61,5 @@ bool almost_equal_relative_and_abs( const double a, const double b, } // namespace math } // namespace myx + +#endif diff --git a/src/myx/math/almost_equal_relative_and_abs.cpp b/src/myx/math/almost_equal_relative_and_abs.cpp index 531587a..50e03dd 100644 --- a/src/myx/math/almost_equal_relative_and_abs.cpp +++ b/src/myx/math/almost_equal_relative_and_abs.cpp @@ -1 +1,5 @@ +#ifndef MYXLIB_BUILD_LIBRARIES +#error Define MYXLIB_BUILD_LIBRARIES to compile this file. +#endif + #include diff --git a/src/myx/math/almost_equal_relative_and_abs.hpp b/src/myx/math/almost_equal_relative_and_abs.hpp index 078a7cd..bd6c9e5 100644 --- a/src/myx/math/almost_equal_relative_and_abs.hpp +++ b/src/myx/math/almost_equal_relative_and_abs.hpp @@ -1,6 +1,8 @@ #ifndef MYX_MATH_ALMOST_EQUAL_RELATIVE_AND_ABS_HPP_ #define MYX_MATH_ALMOST_EQUAL_RELATIVE_AND_ABS_HPP_ +#pragma once + #include #include diff --git a/src/myx/math/almost_equal_ulps-inl.hpp b/src/myx/math/almost_equal_ulps-inl.hpp index 702ed8f..540d8bb 100644 --- a/src/myx/math/almost_equal_ulps-inl.hpp +++ b/src/myx/math/almost_equal_ulps-inl.hpp @@ -1,3 +1,8 @@ +#ifndef MYX_MATH_ALMOST_EQUAL_ULPS_INL_HPP_ +#define MYX_MATH_ALMOST_EQUAL_ULPS_INL_HPP_ + +#pragma once + #ifndef MYXLIB_HEADER_ONLY #include #endif @@ -10,7 +15,7 @@ namespace myx { namespace math { -bool almost_equal_ulps( const float a, const float b, +MYXLIB_INLINE bool almost_equal_ulps( const float a, const float b, const int maxUlpsDiff ) { FloatCmp uA( a ); @@ -46,7 +51,7 @@ bool almost_equal_ulps( const float a, const float b, } // almost_equal_ulps -bool almost_equal_ulps( const double a, const double b, +MYXLIB_INLINE bool almost_equal_ulps( const double a, const double b, const int maxUlpsDiff ) { DoubleCmp uA( a ); @@ -84,3 +89,5 @@ bool almost_equal_ulps( const double a, const double b, } // namespace math } // namespace myx + +#endif diff --git a/src/myx/math/almost_equal_ulps.cpp b/src/myx/math/almost_equal_ulps.cpp index 772dffd..0b0aab4 100644 --- a/src/myx/math/almost_equal_ulps.cpp +++ b/src/myx/math/almost_equal_ulps.cpp @@ -1 +1,5 @@ +#ifndef MYXLIB_BUILD_LIBRARIES +#error Define MYXLIB_BUILD_LIBRARIES to compile this file. +#endif + #include diff --git a/src/myx/math/almost_equal_ulps.hpp b/src/myx/math/almost_equal_ulps.hpp index 5d4cc75..d01389b 100644 --- a/src/myx/math/almost_equal_ulps.hpp +++ b/src/myx/math/almost_equal_ulps.hpp @@ -1,6 +1,8 @@ #ifndef MYX_MATH_ALMOST_EQUAL_ULPS_HPP_ #define MYX_MATH_ALMOST_EQUAL_ULPS_HPP_ +#pragma once + #include #include diff --git a/src/myx/math/almost_equal_ulps_and_abs-inl.hpp b/src/myx/math/almost_equal_ulps_and_abs-inl.hpp index bca19ec..a8b59a2 100644 --- a/src/myx/math/almost_equal_ulps_and_abs-inl.hpp +++ b/src/myx/math/almost_equal_ulps_and_abs-inl.hpp @@ -1,3 +1,8 @@ +#ifndef MYX_MATH_ALMOST_EQUAL_ULPS_INL_HPP_ +#define MYX_MATH_ALMOST_EQUAL_ULPS_INL_HPP_ + +#pragma once + #ifndef MYXLIB_HEADER_ONLY #include #endif @@ -10,7 +15,7 @@ namespace myx { namespace math { -bool almost_equal_ulps_and_abs( const float a, const float b, +MYXLIB_INLINE bool almost_equal_ulps_and_abs( const float a, const float b, const float maxAbsDiff, const int maxUlpsDiff ) { // Check if the numbers are really close -- needed @@ -43,7 +48,7 @@ bool almost_equal_ulps_and_abs( const float a, const float b, } // almost_equal_ulps_and_abs -bool almost_equal_ulps_and_abs( const double a, const double b, +MYXLIB_INLINE bool almost_equal_ulps_and_abs( const double a, const double b, const double maxAbsDiff, const int maxUlpsDiff ) { // Check if the numbers are really close -- needed @@ -78,3 +83,5 @@ bool almost_equal_ulps_and_abs( const double a, const double b, } // namespace math } // namespace myx + +#endif diff --git a/src/myx/math/almost_equal_ulps_and_abs.cpp b/src/myx/math/almost_equal_ulps_and_abs.cpp index a4cfadb..7b0b09d 100644 --- a/src/myx/math/almost_equal_ulps_and_abs.cpp +++ b/src/myx/math/almost_equal_ulps_and_abs.cpp @@ -1 +1,5 @@ +#ifndef MYXLIB_BUILD_LIBRARIES +#error Define MYXLIB_BUILD_LIBRARIES to compile this file. +#endif + #include diff --git a/src/myx/math/almost_equal_ulps_and_abs.hpp b/src/myx/math/almost_equal_ulps_and_abs.hpp index f141795..330090e 100644 --- a/src/myx/math/almost_equal_ulps_and_abs.hpp +++ b/src/myx/math/almost_equal_ulps_and_abs.hpp @@ -1,6 +1,8 @@ #ifndef MYX_MATH_ALMOST_EQUAL_ULPS_HPP_ #define MYX_MATH_ALMOST_EQUAL_ULPS_HPP_ +#pragma once + #include namespace myx { diff --git a/src/myx/math/constants-inl.hpp b/src/myx/math/constants-inl.hpp index eb22bee..39b5ced 100644 --- a/src/myx/math/constants-inl.hpp +++ b/src/myx/math/constants-inl.hpp @@ -1,3 +1,8 @@ +#ifndef MYX_MATH_CONSTANTS_INL_HPP_ +#define MYX_MATH_CONSTANTS_INL_HPP_ + +#pragma once + #ifndef MYXLIB_HEADER_ONLY #include #endif @@ -9,3 +14,5 @@ namespace math { } // namespace math } // namespace myx + +#endif diff --git a/src/myx/math/constants.cpp b/src/myx/math/constants.cpp index 5351b8f..7746367 100644 --- a/src/myx/math/constants.cpp +++ b/src/myx/math/constants.cpp @@ -1 +1,5 @@ +#ifndef MYXLIB_BUILD_LIBRARIES +#error Define MYXLIB_BUILD_LIBRARIES to compile this file. +#endif + #include diff --git a/src/myx/math/constants.hpp b/src/myx/math/constants.hpp index 05f16e8..7db7521 100644 --- a/src/myx/math/constants.hpp +++ b/src/myx/math/constants.hpp @@ -1,6 +1,8 @@ #ifndef MYX_MATH_CONSTANTS_HPP_ #define MYX_MATH_CONSTANTS_HPP_ +#pragma once + #include #include diff --git a/src/myx/math/float_cmp_types.hpp b/src/myx/math/float_cmp_types.hpp index b24d9ea..0acc1aa 100644 --- a/src/myx/math/float_cmp_types.hpp +++ b/src/myx/math/float_cmp_types.hpp @@ -1,6 +1,8 @@ #ifndef MYX_MATH_FLOAT_CMP_TYPES_HPP_ #define MYX_MATH_FLOAT_CMP_TYPES_HPP_ +#pragma once + #include /** diff --git a/src/myx/math/functions.hpp b/src/myx/math/functions.hpp index 3e64da7..4e231b9 100644 --- a/src/myx/math/functions.hpp +++ b/src/myx/math/functions.hpp @@ -1,6 +1,8 @@ #ifndef MYX_MATH_FUNCTIONS_HPP_ #define MYX_MATH_FUNCTIONS_HPP_ +#pragma once + #include #include #include diff --git a/src/myx/math/radar.hpp b/src/myx/math/radar.hpp index e3744f9..8d800b5 100644 --- a/src/myx/math/radar.hpp +++ b/src/myx/math/radar.hpp @@ -1,6 +1,8 @@ #ifndef MYX_MATH_RADAR_HPP_ #define MYX_MATH_RADAR_HPP_ +#pragma once + #include #include diff --git a/src/myx/math/units.hpp b/src/myx/math/units.hpp index 4bf6c7e..5a21e46 100644 --- a/src/myx/math/units.hpp +++ b/src/myx/math/units.hpp @@ -1,6 +1,8 @@ #ifndef MYX_MATH_UNITS_HPP_ #define MYX_MATH_UNITS_HPP_ +#pragma once + #include #include @@ -88,5 +90,4 @@ T magnitude_to_decibel( T const& magnitude ) } // namespace myx - #endif // MYX_MATH_UNITS_HPP_ diff --git a/src/myx/qt/backports.hpp b/src/myx/qt/backports.hpp index a45b10f..0ce776d 100644 --- a/src/myx/qt/backports.hpp +++ b/src/myx/qt/backports.hpp @@ -1,6 +1,8 @@ #ifndef MYX_QT_BACKPORTS_HPP_ #define MYX_QT_BACKPORTS_HPP_ +#pragma once + #if ( defined ( TARGET_LSB_ID_AstraLinuxSE ) && defined ( TARGET_LSB_CODENAME_smolensk ) ) #define override diff --git a/src/myx/qt/translators-inl.hpp b/src/myx/qt/translators-inl.hpp index 20b2936..9367945 100644 --- a/src/myx/qt/translators-inl.hpp +++ b/src/myx/qt/translators-inl.hpp @@ -17,7 +17,7 @@ namespace myx { namespace qt { -void append_translators( QTranslatorsList& translators, const QString& appName ) +MYXLIB_INLINE void append_translators( QTranslatorsList& translators, const QString& appName ) { auto* translator = new QTranslator( qApp ); diff --git a/src/myx/qt/translators.cpp b/src/myx/qt/translators.cpp index ce9c111..496aac7 100644 --- a/src/myx/qt/translators.cpp +++ b/src/myx/qt/translators.cpp @@ -1,2 +1,5 @@ +#ifndef MYXLIB_BUILD_LIBRARIES +#error Define MYXLIB_BUILD_LIBRARIES to compile this file. +#endif + #include -#include diff --git a/src/myx/qt/translators.hpp b/src/myx/qt/translators.hpp index 1529c4c..1131c34 100644 --- a/src/myx/qt/translators.hpp +++ b/src/myx/qt/translators.hpp @@ -1,5 +1,7 @@ -#ifndef MYX_LOG_QT_TRANSLATORS_HPP_ -#define MYX_LOG_QT_TRANSLATORS_HPP_ +#ifndef MYX_QT_TRANSLATORS_HPP_ +#define MYX_QT_TRANSLATORS_HPP_ + +#pragma once #include #include @@ -22,4 +24,4 @@ void append_translators( QTranslatorsList& translators, const QString& appName ) #include "translators-inl.hpp" #endif -#endif // ifndef MYX_LOG_QT_TRANSLATORS_HPP_ +#endif // ifndef MYX_QT_TRANSLATORS_HPP_