Skip to content

Document an includes style, apply to z_demo.c and z_play.c - #2803

Open
Dragorn421 wants to merge 5 commits into
zeldaret:mainfrom
Dragorn421:iwyu_1
Open

Document an includes style, apply to z_demo.c and z_play.c#2803
Dragorn421 wants to merge 5 commits into
zeldaret:mainfrom
Dragorn421:iwyu_1

Conversation

@Dragorn421

@Dragorn421 Dragorn421 commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

I suggest an includes style: see docs/includes.md

Basically,

  • include what you use
  • use IWYU pragmas
  • use <> for libc includes

This aims to be the basis for future includes cleanup

@mzxrules

Copy link
Copy Markdown
Contributor

my only disagreement is that I greatly dislike having special rules only for overlays

@Dragorn421

Copy link
Copy Markdown
Collaborator Author

We could also have .h includes corresponding to the .c for boot/code files at the top of the .c, (eg play_state.h for z_play.c) but that's much less easy to identify and will not be consistent either (like, not all .c in boot/code have a .h) ?

Comment thread docs/includes.md Outdated
@Dragorn421
Dragorn421 requested a review from Thar0 August 19, 2026 12:18
Comment thread docs/includes.md Outdated

@AngheloAlf AngheloAlf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The proposed include order is kinda the opposite of what we have been doing, but I guess it is fine

@Dragorn421
Dragorn421 requested a review from mzxrules August 23, 2026 07:54

@mzxrules mzxrules left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would like this as is for MM too.

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.

4 participants