Files
SimpleRemoter/server/2015Remote/msvc_compat.c
2026-04-19 22:55:21 +02:00

48 lines
1008 B
C

// MSVC CRT compatibility shims for 32-bit builds
// Only provides _legacy versions that are missing from newer CRT
#if defined(_M_IX86) && !defined(_M_X64)
#pragma message(">>> Compiling msvc_compat.c for x86 <<<")
#ifdef __cplusplus
extern "C" {
#endif
// For x86 cdecl, MSVC adds one underscore prefix
// So _ftoul2_legacy becomes __ftoul2_legacy in object file
unsigned __int64 __cdecl _ftoul2_legacy(float x) {
if (x < 0.0f) return 0;
return (unsigned __int64)x;
}
unsigned __int64 __cdecl _dtoul2_legacy(double x) {
if (x < 0.0) return 0;
return (unsigned __int64)x;
}
unsigned __int64 __cdecl _ftoul3_legacy(float x) {
if (x < 0.0f) return 0;
return (unsigned __int64)x;
}
unsigned __int64 __cdecl _dtoul3_legacy(double x) {
if (x < 0.0) return 0;
return (unsigned __int64)x;
}
__int64 __cdecl _ftol3_legacy(float x) {
return (__int64)x;
}
__int64 __cdecl _dtol3_legacy(double x) {
return (__int64)x;
}
#ifdef __cplusplus
}
#endif
#endif // _M_IX86