mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-22 23:48:08 -05:00
fix clang-tidy error in clion on windows when using m_fields
This commit is contained in:
parent
f0127bdb88
commit
05064eb4d5
2 changed files with 13 additions and 2 deletions
|
@ -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<Parent*>(69420);
|
||||
#else
|
||||
return this->operator Parent*();
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -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 Derived, class Base>
|
||||
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; \
|
||||
|
|
Loading…
Reference in a new issue