Skip to content

Conversation

@willvale
Copy link
Contributor

@willvale willvale commented Nov 10, 2025

As discussed - it seemed easiest to share like this as it touches several files.

Added INKCPP_NO_UNREAL, INKCPP_NO_EH, INKCPP_NO_RTTI to further configure INKCPP_API (so I define all of those when building an inkcpp API static library to link to my runtime).
Use new defines to define internal INK_ENABLE_EH, INK_ENABLE_RTTI and change client code to use these rather than INK_ENABLE_UNREAL
Suppress the non-char* getline methods when INK_ENABLE_CSTD is defined.
Replace std:::remove_cv_t+remove_reference_t with new remove_refererence+existing remove_cv
Define sized types when we don't have <ctype>
Verify sized type sizes.

Maybe it would be better with a single define to turn all that on, although I can see gamedev people might want to separate EH and rtti support.

Tested for x64 and x32, all builds and runs happily (although I did have to suppress warnings 4244, 4018 and 4267. But my test isn't exhaustive - I compile and run a complex story, but it's not using any function bindings yet, which might touch more std code.

(This is a cool project by the way. It's a little bit C++ feature heavy for my preference but I can't argue with the results :) Love the flat binary data format. Trying to figure out some whitespace & glue issues next but not getting very far.)

value as present.
Replace unchecked access to _value with checked access for the various
operators.
And define ptrdiff_t using decltype so it works for 32b and 64b arch.
@willvale
Copy link
Contributor Author

Missing 'typename' and I didn't use the right branch, oops.

@JBenda
Copy link
Owner

JBenda commented Nov 11, 2025

Thank you for your input.

I never considered building without EH, but fair point.

The solution with defining NO_RTTI and NO_EH seems good. I will think a bit and write documentation and add it then. ^^

If you do not mind, please share your whitespace & glue issue. We tried our best to behave like ink.

@willvale
Copy link
Contributor Author

I'll create tickets, I think there were two issues - handling of whitespace in optional choice text (square brackets), and handling of whitespace with a complex multi-line conditional text using glue.

Been down an optimisation/correctness rabbit hole this week which might produce more PRs.

@JBenda
Copy link
Owner

JBenda commented Nov 28, 2025

Was there a reason for the NO_UNREAL define?

INKCPP_API is defined from the UE build system and will therefore only ever be defined iff UE is building. Did I miss something there?

Else I introduced cmake options to enable the defines, so it is easier to find them.

@willvale
Copy link
Contributor Author

Probably just me setting things up badly - I was building a library to use the Inkcpp runtime API so I assumed I needed INKCPP_API. (I'm using premake not CMake so don't get the auto configure.)

I'll try without it, if that works then NO_UNREAL shouldn't be needed.

Sorry about the delay - been busy with (many) other things this week.

@JBenda
Copy link
Owner

JBenda commented Nov 28, 2025

Ok, that makes sense.

Hope I did not break anything. ^^

No need to stress yourself. I think it is going forward at a good pace.
Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants