-
Notifications
You must be signed in to change notification settings - Fork 149
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
Add macros 'PATHTO_FNC ' and 'RECOMPILE' #475
Conversation
@@ -796,6 +796,17 @@ Macro: GVARMAIN() | |||
#define PREPMAIN(var1) ['PATHTO_SYS(PREFIX,COMPONENT_F,DOUBLES(fnc,var1))', 'TRIPLES(PREFIX,fnc,var1)'] call SLX_XEH_COMPILE_NEW | |||
#endif | |||
|
|||
#ifdef RECOMPILE | |||
#define RECOMPILE recompile = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this work with Mikero's Tools? I think they error out now when trying to redefine a macro in config space.
At least when using make.py
(binarizing)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add #undef
to keep the macro parsers happy
Would be cool if we could redefine it for Also we might want to think about a potentially better name than |
Those edits are actually good, removing redundant whitespace. 👍 😆 |
How about |
|
Done. Added variant of |
If you want to emulate |
Personally I like |
#undef RECOMPILE | ||
#define RECOMPILE recompile = 1 | ||
#else | ||
#undef RECOMPILE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If RECOMPILE already is undefined, you cannot undefine RECOMPILE. This might or might not error out with Mikeros Tools too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, undef is only needed in the first case, where RECOMPILE
is defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still needs action.
@jonpas making it This reminds me. We should simplify |
Macro header added for explanation. |
This is done unless |
Yes it is, |
Ah ok. Didn't realize it was a macro already. Utilizing |
Do not '#undef RECOMPILE' if 'RECOMPILE' already undefined
FYI, the RECOMPILE changes broke Mikero tools for ALiVE and probably others. We had to update all the CfgFunctions.hpp files. 😢 |
Mikero's Tools can't handle macro redefinitions anymore. I guess you had a macro named |
Yes we have a global macro |
In |
Yeah. This is the only solution. No idea why this change was made. It's really stupid. |
When merged this pull request will:
PATHTO_FNC
andRECOMPILE
PATHTO_FNC
is the name of a function that is located at\MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT\
and the name of the file isfnc_func.sqf
where 'func' is the name of you're function.func
will be the argument forPATHTO_FNC
RECOMPILE
does not accept an argument. IfRECOMPILE
is defined before includingscript_macros_common.hpp
in you're component, then the functions defined withPATHTO_FNC
will be recompiled at mission start. (For debug purposes)These macros emulate the below...
The macro 'PATHTO_FNC ' can be found already in the components
common
andsettings
. Just making it official :)Ignore the edits to
build.py
. I guess I removed some spaces or something but no edits to any of the code.