mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-08 13:01:52 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user