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

[preprocessor]: Surrounding #inline under other macros will brick the tool #203

Closed
diamante0018 opened this issue Mar 20, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@diamante0018
Copy link
Contributor

#define TOOL

#if defined(TOOL)
#inline scripts\mp\_utility;
#else
// empty
#endif

Unexpected behaviour:
Com_ERROR: [ERROR]:preprocessor:scripts/mp/_utility.gsh:136:1: missing #endif

Expected behaviour:
Compilation succeeds

Using https://git.alterware.dev/AlterWare/jump-gsc/src/branch/main/iw5/scripts/mp/_utility.gsh

Note!!!
There is nothing wrong with the header when used on Plutonium IW5
https://git.alterware.dev/AlterWare/jump-gsc/src/branch/main/iw5/scripts/mp/_jump.gsc#L7
Here there is a single #inline and there are no issues

@diamante0018
Copy link
Contributor Author

Smaller example

_test.gsh

#define TEST print("hello")

main gsc

#inline _test;

main()
{
    TEST;
}
.\gsc-tool.exe -m comp -g iw5 -s pc .\a.gsc
GSC Tool 1.4.3.297-prod created by xensik
compiled iw5/a.gscbin

HOWEVER

main gsc

#if 1
#inline _test;
#endif

main()
{
    TEST;
}
.\gsc-tool.exe -m comp -g iw5 -s pc .\a.gsc
GSC Tool 1.4.3.297-prod created by xensik
[ERROR]:preprocessor:_test.gsh:2:1: missing #endif at ./a.gsc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants