diff --git a/.cppcheck.suppress b/.cppcheck.suppress index e0e3a7f..ca019ff 100644 --- a/.cppcheck.suppress +++ b/.cppcheck.suppress @@ -1 +1,2 @@ -unusedFunction \ No newline at end of file +unusedFunction +duplInheritedMember \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ea54dd7..2c5d8a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. ## Next Release +### Enum + +- define only forward declaration if MOC_RUN compilation is processing enum definition + ## [0.1.1](https://github.com/repo/owner/releases/tag/0.1.1) - 2026-03-09 diff --git a/include/mstd/enum.hpp b/include/mstd/enum.hpp index ba55f88..b6f2087 100644 --- a/include/mstd/enum.hpp +++ b/include/mstd/enum.hpp @@ -49,6 +49,7 @@ // ------------------------------------------------------------ // Main macro // ------------------------------------------------------------ +#ifndef Q_MOC_RUN #define MSTD_ENUM(EnumName, Underlying, LIST) \ enum class EnumName : Underlying \ { \ @@ -118,6 +119,9 @@ }; \ \ static constexpr EnumName##Meta enum_meta(EnumName) { return {}; } +#else +#define MSTD_ENUM(EnumName, Underlying, LIST) enum class EnumName : Underlying; +#endif #define MSTD_ENUM_BITFLAG(EnumName, Underlying, LIST) \ MSTD_ENUM(EnumName, Underlying, LIST) \