Skip to content

Add #pragma once to all headers without an include guard - #726

Merged
arch1t3cht merged 1 commit into
TypesettingTools:masterfrom
CoffeeFlux:pragma-once
Oct 8, 2026
Merged

arch1t3cht merged 1 commit into
TypesettingTools:masterfrom
CoffeeFlux:pragma-once

Conversation

@CoffeeFlux

Copy link
Copy Markdown
Member

Most of Aegisub's own headers (161 of them) had no include guard, so including one twice in a translation unit was a redefinition error. Builds only worked because no source file happened to include any of them twice. This also blocks unity builds.

  • Adds #pragma once after the license comment, matching the 47 headers that already used it.
  • Headers that already have an #ifndef guard are left alone: the third-party lpeg.h, avisynth.h, gl/glext.h and MatroskaParser.h.
  • No header is meant to be included more than once (no X-macro style headers).

Tested locally on macOS: builds with PCH on and off, test suites pass, no new warnings.

🤖 Generated with Claude Code

Most of Aegisub's own headers had no include guard, so including one twice
in a translation unit was a redefinition error. Headers that already
have a guard are left alone: the third-party lpeg.h, avisynth.h,
gl/glext.h and MatroskaParser.h.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CoffeeFlux
CoffeeFlux marked this pull request as ready for review October 8, 2026 18:26
@arch1t3cht
arch1t3cht merged commit 7299f86 into TypesettingTools:master Oct 8, 2026
9 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