Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error when using custom RTTI #514

Closed
doctorames opened this issue Sep 20, 2023 · 1 comment
Closed

Compile error when using custom RTTI #514

doctorames opened this issue Sep 20, 2023 · 1 comment
Labels
build Build system and compilation

Comments

@doctorames
Copy link

Howdy

When using custom RTTI (/DRMLUI_USE_CUSTOM_RTTI), getting compile error:

....foo\Core\Traits.h(131): error C2039: 'RttiClassType': is not a member of 'Rml::InlineBox'

Just need a little macro love in InlineBox.h and InlineLevelBox.h:

InlineBox.h:

class InlineBoxBase : public InlineLevelBox {
public:
	RMLUI_RTTI_DefineWithParent(InlineBoxBase, InlineLevelBox)
...
...
class InlineBox final : public InlineBoxBase {
public:
	RMLUI_RTTI_DefineWithParent(InlineBox, InlineBoxBase)
...
...
class InlineBoxRoot final : public InlineBoxBase {
public:
	RMLUI_RTTI_DefineWithParent(InlineBoxRoot, InlineBoxBase)

InlineLevelBox.h:

class InlineLevelBox {
public:
	RMLUI_RTTI_Define(InlineLevelBox)

I fixed this in my local copy. Obviously I don't have PR access so if one of yall gets a chance, easy fix. (Assuming this is the proper fix. 😄 )

Thanks!
d

mikke89 added a commit that referenced this issue Sep 22, 2023
Employ it around the library for extra debug checks (only with rtti enabled).
@mikke89 mikke89 added the build Build system and compilation label Sep 22, 2023
@mikke89
Copy link
Owner

mikke89 commented Sep 22, 2023

Thanks for reporting! And for suggesting a solution. Please know that PRs are very much welcome and open for everybody, so don't be shy ;)

I went for a different solution than suggested. It would have worked perfectly fine, but we don't really need RTTI here as it was only used for a single assertion. Instead I made a semi-related change that should also fix this issue. I've wanted to implement something like this for a while, and this was a good excuse. Let me know if there are any issues with the changes.

@mikke89 mikke89 closed this as completed Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build system and compilation
Projects
None yet
Development

No branches or pull requests

2 participants