Skip to content

Conversation

@Jan200101
Copy link
Contributor

This makes it C compatible without impacting anything in C++

@vrn-sn vrn-sn self-requested a review October 27, 2025 02:11
@vrn-sn
Copy link
Member

vrn-sn commented Oct 27, 2025

Is it possible to update the original struct/enum definitions themselves to be typedefs? For example,

typedef enum luarequire_NavigateResult
{
    NAVIGATE_SUCCESS,
    NAVIGATE_AMBIGUOUS,
    NAVIGATE_NOT_FOUND
} luarequire_NavigateResult;

I believe this should keep function signatures and call sites identical in C and in C++.

@Jan200101
Copy link
Contributor Author

sure, I'll do that ASAP.

@vrn-sn
Copy link
Member

vrn-sn commented Oct 28, 2025

Sounds good, then we can also undo all these function signature changes. I believe it should just work in C as well.

@Jan200101
Copy link
Contributor Author

implemented and tested against a C project

only issue I could find (that was masked by something else in my project) is that bool is not a standard keyword in C but that can be fixed/worked around by including stdbool.h first.

@vrn-sn
Copy link
Member

vrn-sn commented Oct 28, 2025

In that case, would you mind adding #include <stdbool.h> above the existing #include <stddef.h> (keeping them alphabetical)? I'll merge this after that.

This makes the use keyword-less use of them consistent
across C and C++.
@vrn-sn
Copy link
Member

vrn-sn commented Oct 28, 2025

Thanks for the contribution!

@vrn-sn vrn-sn merged commit 6b78796 into luau-lang:master Oct 28, 2025
7 checks passed
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