36double round_msvc(
double x) {
return (floor(x + 0.5)); }
42extern long __stdcall MyUnhandledExceptionFilter(
43 struct _EXCEPTION_POINTERS *ExceptionInfo) {
46 switch (ExceptionInfo->ExceptionRecord->ExceptionCode) {
47 case EXCEPTION_FLT_DENORMAL_OPERAND:
48 case EXCEPTION_FLT_DIVIDE_BY_ZERO:
49 case EXCEPTION_FLT_INEXACT_RESULT:
50 case EXCEPTION_FLT_INVALID_OPERATION:
51 case EXCEPTION_FLT_OVERFLOW:
52 case EXCEPTION_FLT_STACK_CHECK:
53 case EXCEPTION_FLT_UNDERFLOW:
55 return EXCEPTION_CONTINUE_EXECUTION;
58 return EXCEPTION_CONTINUE_SEARCH;
65extern int mysnprintf(
char *buffer,
int count,
const char *format, ...) {
69 va_start(arg, format);
70 ret = _vsnprintf(buffer, count, format, arg);
77int NextPow2(
int size) {