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

Metaprogram #3967

Closed
wants to merge 2 commits into from
Closed

Metaprogram #3967

wants to merge 2 commits into from

Conversation

cfmnephrite
Copy link

Took Mr. Griffin's metaprogram.h from a dead PR (#2363 ) and made it into its own PR since it's quite useful and will hopefully have a lot of applications going forwards for making more powerful macros. As a little demonstration, added my own DEFAULT macro and applied it in battle_main.c.

Description

  • Combined multiple useful macros into a single metaprogram.h for neatness, including:
    • FIRST/SECOND/THIRD/FOURTH macros
    • recursive macros
    • moved useful macros from global.h
  • Added DEFAULT/DEFAULT_2 macros to allow macros to assign values either from VA_ARGS or from a provided default
    • Demonstrated in battle_main
    • Potential other applications: species_info and more

Discord contact info

thechurchofcage/Cancer Fairy

mrgriffin and others added 2 commits January 11, 2024 12:58
Created by Mr. Griffin. Removed non-relevant parts

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Also added a demonstration in battle_main
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.

None yet

2 participants