Skip to content

build: Fix compile error in Smudge.h with docker-build - #2701

Merged
xezon merged 2 commits into
TheSuperHackers:mainfrom
ucosty:issue-2674-fix-build-error
Jun 29, 2026
Merged

build: Fix compile error in Smudge.h with docker-build#2701
xezon merged 2 commits into
TheSuperHackers:mainfrom
ucosty:issue-2674-fix-build-error

Conversation

@ucosty

@ucosty ucosty commented May 12, 2026

Copy link
Copy Markdown

This short fix gets the build working again, and should close out issue #2674

… docker-build

This short fix gets the build working again, and should close out
issue TheSuperHackers#2674
@greptile-apps

greptile-apps Bot commented May 12, 2026

Copy link
Copy Markdown

Greptile Summary

Fixes a compile error when building with Docker by adding the missing #include <Utility/hash_map_adapter.h> to Smudge.h. The adapter shim aliases std::hash_map to std::unordered_map on modern GCC/Clang compilers that do not ship <hash_map>, while continuing to use the native STLPort or old-MSVC header when those environments are detected.

  • SmudgeSet declared std::hash_map<Smudge::Identifier, Smudge *> without the header that makes std::hash_map available on non-STLPort/non-MSVC toolchains, causing the docker build to fail.
  • The fix is one line and is the minimal correct change; the existing #ifdef USING_STLPORT hash-specialisation block remains untouched and still handles STLPort correctly.

Confidence Score: 5/5

This is a one-line include addition that restores compilation on modern toolchains without altering any runtime logic.

The change is surgical — it adds only the missing include that exposes std::hash_map on non-STLPort, non-old-MSVC compilers. No logic, data structures, or behaviour are modified. The adapter header correctly handles all three targeted environments (STLPort, old MSVC, modern GCC/Clang) and is already used elsewhere in the codebase.

No files require special attention.

Important Files Changed

Filename Overview
Core/GameEngine/Include/GameClient/Smudge.h Adds missing #include <Utility/hash_map_adapter.h> so std::hash_map resolves on modern GCC/Clang (docker) compilers that lack <hash_map>.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["Smudge.h included"] --> B{"Compiler / STL environment?"}
    B -->|"USING_STLPORT or MSVC < 13"| C["hash_map_adapter.h → #include <hash_map>"]
    B -->|"Modern GCC / Clang (Docker)"| D["hash_map_adapter.h → std::hash_map = std::unordered_map alias"]
    C --> E["std::hash_map available ✓"]
    D --> E
    E --> F["SmudgeSet::SmudgeIdToPtrMap compiles successfully"]
Loading

Reviews (2): Last reviewed commit: "Following the suggestion from @xezon, ma..." | Re-trigger Greptile

@xezon xezon changed the title bugfix(build): Issue #2674: Resolve build failure experienced through docker-build build: Fix compile error in Smudge.h with docker-build May 12, 2026
@xezon xezon added Minor Severity: Minor < Major < Critical < Blocker CompileBug Bug at compile time labels May 12, 2026
Comment thread Core/GameEngine/Include/GameClient/Smudge.h Outdated

@Caball009 Caball009 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I say we move forward with this PR. We could even revert it if a fix for #2720 supersedes it.

@xezon
xezon merged commit f03f2fa into TheSuperHackers:main Jun 29, 2026
1 check passed
atraber pushed a commit to atraber/GeneralsGameCode that referenced this pull request Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CompileBug Bug at compile time Minor Severity: Minor < Major < Critical < Blocker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants