A small compiler-guard macro would keep this portable: define GFX_NO_INLINE as __attribute__((noinline)) for GCC/Clang, __declspec(noinline) for MSVC, and empty otherwise, then annotate both _gfxGetStackState and _gfxGetStackStateInFn. A brief comment noting that the stack detection depends on frame layout would also help prevent future refactors from removing it.