surface.offset_surface: portable worker-guard flag; test the no-wrap path

Replace the GCC/Clang-only weak symbol with a plain flag the shim defines
(at namespace scope, external linkage) and the worker's main() sets when it
is linked with its NLib --wrap wrappers. Verified the non-Linux branch by
forcing it on Linux: the worker builds without __wrap_ symbols and refuses
every extension step; the regression now asserts that per platform.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Pluto-XI
2026-10-16 11:53:05 -06:00
parent d2c45e1733
commit 9be2c68dfe
4 changed files with 19 additions and 10 deletions
+3 -1
View File
@@ -115,7 +115,6 @@ extern "C" NL_FLAG __wrap_N_SrfCopy(NL_SURFACE* source, NL_SURFACE* target,
return __real_N_SrfCopy(source, target, stack);
}
extern "C" int sc_offset_extension_guards() { return 1; }
#endif // SC_OFFSET_NO_LINK_WRAP
template <class T> bool read(T& value)
@@ -129,6 +128,9 @@ template <class T> void write(const T& value)
int main()
{
#ifndef SC_OFFSET_NO_LINK_WRAP
sc_offset_extension_guards_enabled = 1;
#endif
int32_t op;
uint64_t count;
if (!read(op) || !read(count) || count == 0 || count > 1048576) return 2;