Skip to content

Set language linkage to "C" when compiling C++#40

Merged
mkst merged 2 commits intomkst:mainfrom
tclamb:main
Mar 16, 2026
Merged

Set language linkage to "C" when compiling C++#40
mkst merged 2 commits intomkst:mainfrom
tclamb:main

Conversation

@tclamb
Copy link
Contributor

@tclamb tclamb commented Mar 16, 2026

Using mwccgap as-is within a C++ project fails with the following signature:

Exception processing lighting.cpp: func_08860760 not found in src/lighting.cpp
Traceback (most recent call last):
  File "./tools/mwccgap/mwccgap.py", line 64, in main
    process_c_file(
  File "./tools/mwccgap/mwccgap/mwccgap.py", line 128, in process_c_file
    raise Exception(f"{function} not found in {c_file}")
Exception: func_08860760 not found in src/lighting.cpp

Wrapping every INCLUDE_*() statement with extern "C" works around this issue, but adds friction to the workflow.

This change adds the typical #ifdef __cplusplus-guarded language linkage statements to the preprocessed c output.

tclamb added a commit to tclamb/mhp2g-decomp that referenced this pull request Mar 16, 2026
tclamb added a commit to tclamb/mhp2g-decomp that referenced this pull request Mar 16, 2026
@mkst
Copy link
Owner

mkst commented Mar 16, 2026

Sweet, happy for me to merge this?

@tclamb
Copy link
Contributor Author

tclamb commented Mar 16, 2026

Yeah, we're good to go.

@mkst mkst merged commit 459c02b into mkst:main Mar 16, 2026
3 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