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

system: emit runtime error when luaL_Stream is unavailable #1918

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

takase1121
Copy link
Member

@takase1121 takase1121 commented Oct 25, 2024

This PR turns the hard compilation error into an runtime error, when luaL_Stream is not available. I'm not sure if this is the way to go.

src/api/system.c Outdated Show resolved Hide resolved
src/api/system.c Show resolved Hide resolved
takase1121 and others added 2 commits October 25, 2024 19:13
@takase1121 takase1121 changed the title system: fix ftruncate not available in Windows system: emit runtime error when luaL_Stream is unavailable Oct 25, 2024
src/api/system.c Outdated Show resolved Hide resolved
src/api/system.c Outdated
// but it is not standardized. YMMV.
#error luaL_Stream is not supported in this version of Lua.
#endif
#ifdef LUA_FILEHANDLE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if you could do an early exit with #ifndef, without an #else block.
Would that raise unreachable code warnings?

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

Successfully merging this pull request may close these issues.

2 participants