#ifndef WIN32_H #define WIN32_H #ifdef WIN32 #define for if (false) {} else for #define unlink(f) _unlink(f) #define drand48() ((double) rand() / (double) RAND_MAX) #define srand48(t) srand(t) #define cbrt(x) pow(x, 1.0/3.0) // #if defined(_MSC_VER) && _MSC_VER <= 1200 #pragma warning(disable:4786) // http://support.microsoft.com/support/kb/articles/Q167/3/55.ASP // states that yes, it's a compiler bug that // #pragma warning(disable: 4786) doesn't always work. // They don't, however, list a workaround. // I found that, very strangely, #including made the // remaining 4786 warnings go away! // Of course, #including is inefficient and // slows compilation - so I whittled away most of what's in // and discovered that the "active ingredient" in // appears to be a declaration of a static class, // complete with default constructor. // For some reason, this works around the bug! // Why does this work? Beats me, ask those smart guys at MS who // wrote the compiler. class msVC6_4786WorkAround { public: msVC6_4786WorkAround() {} }; static msVC6_4786WorkAround WowIWonderWhatCrapCodeMustBeInTheCompilerToMakeThisWorkaroundWork; #endif #include using std::ifstream; using std::ofstream; #include using std::ios; using std::istream; using std::ostream; using std::cin; using std::cout; using std::cerr; using std::endl; using std::flush; #include using std::string; #endif // WIN32 #endif // WIN32_H