diff --git a/loader/include/Geode/modify/Field.hpp b/loader/include/Geode/modify/Field.hpp index 37345f71..cfe47042 100644 --- a/loader/include/Geode/modify/Field.hpp +++ b/loader/include/Geode/modify/Field.hpp @@ -124,7 +124,18 @@ namespace geode::modifier { } Parent* operator->() { + // workaround for "static assertion is not an integral constant expression" in CLion + // while the solution in https://github.com/microsoft/STL/issues/3311 works, you can't provide + // cli args to clang-tidy in clion, so we use this workaround instead + // https://youtrack.jetbrains.com/issue/CPP-27446/spurious-offsetof-in-staticassert-error-from-clangd#focus=Comments-27-8172811.0-0 + // update: that workaround didn't work, + // undefining and re-defining offsetof caused another error further down + // so we're doing this now +#ifdef __CLION_IDE__ + return reinterpret_cast(69420); +#else return this->operator Parent*(); +#endif } }; diff --git a/loader/include/Geode/modify/Modify.hpp b/loader/include/Geode/modify/Modify.hpp index cbf96ccb..2cd0591d 100644 --- a/loader/include/Geode/modify/Modify.hpp +++ b/loader/include/Geode/modify/Modify.hpp @@ -130,7 +130,7 @@ namespace geode { // with an error of "incomplete type is not allowed", despite not being an issue in actual compilation. // So as a workaround use the compiler defined "__INTELLISENSE__" macro, which gets set to 1 on the intellisense pass. // See https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-170#microsoft-specific-predefined-macros -#if __INTELLISENSE__ != 1 +#if __INTELLISENSE__ != 1 && !defined(__CLION_IDE__) template class Modify : public Base { @@ -189,7 +189,7 @@ namespace geode { * I am bad at this stuff */ -#if __INTELLISENSE__ != 1 +#if __INTELLISENSE__ != 1 && !defined(__CLION_IDE__) #define GEODE_MODIFY_DECLARE_ANONYMOUS(base, derived) \ derived##Dummy; \