Skip to content

Add platform-specific DETOUR macros#21

Merged
voided merged 2 commits intovoided:masterfrom
A1mDev:master
Oct 23, 2025
Merged

Add platform-specific DETOUR macros#21
voided merged 2 commits intovoided:masterfrom
A1mDev:master

Conversation

@A1mDev
Copy link
Contributor

@A1mDev A1mDev commented Oct 23, 2025

This PR introduces a new macro, DETOUR_CUSTOM_STATIC2, to unify detour declarations
across different platforms and Source Engine versions, improving code readability.

  • Linux i386 (TF2) → uses attribute((regparm(2)))
  • Windows (CSGO) → uses __fastcall
  • All other platforms → falls back to standard DETOUR_DECL_STATIC2

By consolidating detour declarations into a single macro, code is easier to read,
maintain, and less error-prone across different platforms and ABIs.

…ndows)

This PR introduces a new macro, DETOUR_CUSTOM_STATIC2, to unify detour declarations
across different platforms and Source Engine versions, improving code readability.

- Linux i386 (TF2) → uses __attribute__((regparm(2)))
- Windows (CSGO) → uses __fastcall
- All other platforms → falls back to standard DETOUR_DECL_STATIC2

By consolidating detour declarations into a single macro, code is easier to read,
maintain, and less error-prone across different platforms and ABIs.
@A1mDev
Copy link
Contributor Author

A1mDev commented Oct 23, 2025

Related 2b887d4

@voided voided merged commit ce3acea into voided:master Oct 23, 2025
0 of 4 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