Skip to content

Modify int_proxy to Support Building Without CRT #15

Description

@DeHby

int_proxy currently uses floating-point operations, which cause MSVC to pull in _ftol3.obj and other CRT dependencies when building with /NODEFAULTLIB.

We should replace the floating-point math with integer-based logic to remove the CRT requirement while keeping the same control-flow macros and structure intact.

volatile static INLINE int int_proxy(long long val) {
	INDIRECT_BRANCH;
	volatile long long a = val * (_7 - (_3 * 2));
	BLOCK_TRUE(
		BLOCK_FALSE(
			return _RND;
		)
	)
		BLOCK_TRUE(
				loc_end:
	if (_RND)
		return (int)((a ^ _TRUE) & 0x7FFFFFFF); 
loc_fake:
	return _RND;
		)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions