-#ifndef ARCH_SETUP_WINDOWS_H\r
-#define ARCH_SETUP_WINDOWS_H\r
-\r
-#define HAVE_FFMPEG\r
-\r
-/* Fix VC breakage. */\r
-#define PATH_MAX _MAX_PATH\r
-\r
-#if _MSC_VER < 1300 /* VC6, not VC7 */\r
-#define NEED_MINMAX_TEMPLATES 1\r
-#endif\r
-\r
-// HACK: Fake correct scoping rules in VC6.\r
-#if _MSC_VER == 1200 \r
-#define for if(0); else for\r
-#endif\r
-\r
-#if defined(__MINGW32__)\r
-#define _WINDOWS // This isn't defined under MinGW\r
-#define NEED_CSTDLIB_WORKAROUND // Needed for llabs() in MinGW\r
-#endif\r
-\r
-#if defined(_MSC_VER)\r
-\r
-#if _MSC_VER == 1400 // VC8 specific warnings\r
-#pragma warning (disable : 4996) // deprecated functions vs "ISO C++ conformant names". (stricmp vs _stricmp)\r
-#pragma warning (disable : 4005) // macro redefinitions (ARRAYLEN)\r
-#endif\r
-\r
-#define snprintf _snprintf // Unsure if this goes with __MINGW32__ right now.\r
-\r
-#pragma warning (disable : 4275) // non dll-interface class 'stdext::exception' used as base for dll-interface class 'std::bad_cast', bug in VC <exception> when exceptions disabled\r
-#pragma warning (disable : 4201) // nonstandard extension used : nameless struct/union (Windows headers do this)\r
-#pragma warning (disable : 4786) // turn off broken debugger warning\r
-#pragma warning (disable : 4512) // assignment operator could not be generated (so?)\r
-/* "unreachable code". This warning crops up in incorrect places (end of do ... while(0)\r
- * blocks, try/catch blocks), and I've never found it to be useful. */\r
-#pragma warning (disable : 4702) // assignment operator could not be generated (so?)\r
-/* "unreferenced formal parameter"; we *want* that in many cases */\r
-#pragma warning (disable : 4100)\r
-/* "case 'aaa' is not a valid value for switch of enum 'bbb'\r
- * Actually, this is a valid warning, but we do it all over the\r
- * place, eg. with ScreenMessages. Those should be fixed, but later. XXX */\r
-#pragma warning (disable : 4063)\r
-#pragma warning (disable : 4127)\r
-#pragma warning (disable : 4786) /* VC6: identifier was truncated to '255' characters in the debug information */\r
-#pragma warning (disable : 4505) // removed unferenced local function from integer.cpp & algebra.h\r
-#pragma warning (disable : 4244) // converting of data = possible data loss. (This pragma should eventually go away)\r
-#pragma warning (disable : 4355) // 'this' : used in base member initializer list\r
-\r
-/* Fix VC breakage. */\r
-#define PATH_MAX _MAX_PATH\r
-\r
-/* Disable false deprecation warnings in VC2005. */\r
-#define _CRT_SECURE_NO_DEPRECATE\r
-#define _SCL_SECURE_NO_DEPRECATE \r
-\r
-/* Disable false deprecation warnings in VC2008. */\r
-#define _CRT_NONSTDC_NO_WARNINGS\r
-\r
-#if defined(_MSC_VER) && _MSC_VER >= 1400 // this is needed in VC8 but breaks VC7\r
-#define _HAS_EXCEPTIONS 0\r
-#endif\r
-\r
-/* Don't include windows.h everywhere; when we do eventually include it, use these: */\r
-#define WIN32_LEAN_AND_MEAN\r
-#define VC_EXTRALEAN\r
-\r
-/* Pull in NT-only definitions. Note that we support Win98 and WinME; you can make\r
- * NT calls, but be sure to fall back on 9x if they're not supported. */\r
-#define _WIN32_WINNT 0x0400\r
-#define _WIN32_IE 0x0400\r
-\r
-/* If this isn't defined to 0, VC fails to define things like stat and alloca. */\r
-#define __STDC__ 0\r
-\r
-#endif\r
-\r
-#include <direct.h> /* has stuff that should be in unistd.h */\r
-#include <wchar.h> /* needs to be included before our fixes below */\r
-\r
-#define lstat stat\r
-#define fsync _commit\r
-#define isnan _isnan\r
-#define finite _finite\r
-\r
-/* mkdir is missing the mode arg */\r
-#define mkdir(p,m) mkdir(p)\r
-\r
-typedef time_t time_t;\r
-struct tm;\r
-struct tm *my_localtime_r( const time_t *timep, struct tm *result );\r
-#define localtime_r my_localtime_r\r
-struct tm *my_gmtime_r( const time_t *timep, struct tm *result );\r
-#define gmtime_r my_gmtime_r\r
-void my_usleep( unsigned long usec );\r
-#define usleep my_usleep\r
-\r
-/*\r
-#ifndef WIN32\r
-#include "stdint.h"\r
-#else\r
-typedef signed char int8_t;\r
-typedef unsigned char uint8_t;\r
-typedef signed short int16_t;\r
-typedef unsigned short uint16_t;\r
-typedef int int32_t;\r
-typedef unsigned int uint32_t;\r
-typedef __int64 int64_t;\r
-typedef unsigned __int64 uint64_t;\r
-#endif\r
-static inline int64_t llabs( int64_t i ) { return i >= 0? i: -i; }\r
-*/\r
-\r
-/* Missing stdint types: */\r
-#if !defined(__MINGW32__) // MinGW headers define these for us\r
-typedef signed char int8_t;\r
-typedef signed short int16_t;\r
-typedef int int32_t;\r
-typedef __int64 int64_t;\r
-typedef unsigned char uint8_t;\r
-typedef signed short int16_t;\r
-typedef unsigned short uint16_t;\r
-typedef int int32_t;\r
-typedef unsigned int uint32_t;\r
-typedef __int64 int64_t;\r
-typedef unsigned __int64 uint64_t;\r
-#define INT64_C(i) i##i64\r
-#define UINT64_C(i) i##i64\r
-#if _MSC_VER < 1600 // 1600VC++ 2010\r
-static inline int64_t llabs( int64_t i ) { return i >= 0? i: -i; }\r
-#endif\r
-#endif\r
-\r
-\r
-//#if defined(_MSC_VER)\r
-//#pragma warning (disable : 4800) /* Forcing value to bool 'true' or 'false' - that's the whole point. Why warn us? */\r
-//#endif\r
-\r
-#undef min\r
-#undef max\r
-#define NOMINMAX /* make sure Windows doesn't try to define this */\r
-\r
-/* Windows is missing some basic math functions: */\r
-#if !defined(__MINGW32__)\r
-#define NEED_TRUNCF\r
-#define NEED_ROUNDF\r
-#define NEED_STRTOF\r
-#endif\r
-//our cross-platform stdint covers us here\r
-//#define MISSING_STDINT_H\r
-\r
-#if !defined(__MINGW32__)\r
-inline int lrintf( float f )\r
-{\r
- int retval;\r
-\r
- _asm fld f;\r
- _asm fistp retval;\r
-\r
- return retval;\r
-}\r
-#endif\r
-\r
-/* For RageLog. */\r
-#define HAVE_VERSION_INFO\r
-\r
-/* We implement the crash handler interface (though that interface isn't completely\r
- * uniform across platforms yet). */\r
-#if defined(_XBOX)\r
- // no crash handler on Xbox\r
-#else\r
-# define CRASH_HANDLER\r
-#endif\r
-\r
-#define ENDIAN_LITTLE\r
-\r
-#if defined(XBOX)\r
-#include "ArchUtils/Xbox/arch_setup.h"\r
-#endif\r
-\r
-#define HAVE_BYTE_SWAPS\r
-\r
-inline uint32_t ArchSwap32( uint32_t n )\r
-{\r
- __asm\r
- {\r
- mov eax, n\r
- xchg al, ah\r
- ror eax, 16\r
- xchg al, ah\r
- mov n, eax\r
- };\r
- return n;\r
-}\r
-\r
-inline uint32_t ArchSwap24( uint32_t n )\r
-{\r
- __asm\r
- {\r
- mov eax, n\r
- xchg al, ah\r
- ror eax, 16\r
- xchg al, ah\r
- ror eax, 8\r
- mov n, eax\r
- };\r
- return n;\r
-}\r
-\r
-inline uint16_t ArchSwap16( uint16_t n )\r
-{\r
- __asm\r
- {\r
- mov ax, n\r
- xchg al, ah\r
- mov n, ax\r
- };\r
- return n;\r
-}\r
-\r
-#endif\r
-\r
-/*\r
- * (c) 2002-2004 Glenn Maynard\r
- * (c) 2008 BoXoRRoXoRs\r
- * All rights reserved.\r
- * \r
- * Permission is hereby granted, free of charge, to any person obtaining a\r
- * copy of this software and associated documentation files (the\r
- * "Software"), to deal in the Software without restriction, including\r
- * without limitation the rights to use, copy, modify, merge, publish,\r
- * distribute, and/or sell copies of the Software, and to permit persons to\r
- * whom the Software is furnished to do so, provided that the above\r
- * copyright notice(s) and this permission notice appear in all copies of\r
- * the Software and that both the above copyright notice(s) and this\r
- * permission notice appear in supporting documentation.\r
- * \r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\r
- * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS\r
- * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT\r
- * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS\r
- * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r
- * PERFORMANCE OF THIS SOFTWARE.\r
- */\r
+#ifndef ARCH_SETUP_WINDOWS_H
+#define ARCH_SETUP_WINDOWS_H
+
+#define HAVE_FFMPEG
+
+#if !defined(XBOX)
+#define SUPPORT_OPENGL
+#endif
+
+#define SUPPORT_D3D
+
+/* Fix VC breakage. */
+#define PATH_MAX _MAX_PATH
+
+#if _MSC_VER < 1300 /* VC6, not VC7 */
+#define NEED_MINMAX_TEMPLATES 1
+#endif
+
+// HACK: Fake correct scoping rules in VC6.
+#if _MSC_VER == 1200
+#define for if(0); else for
+#endif
+
+/* Don't include windows.h everywhere; when we do eventually include it, use these: */
+#define WIN32_LEAN_AND_MEAN
+#define VC_EXTRALEAN
+
+/* Pull in NT-only definitions. Note that we support Win98 and WinME; you can make
+ * NT calls, but be sure to fall back on 9x if they're not supported. */
+#define _WIN32_WINNT 0x0400
+
+/* If this isn't defined to 0, VC fails to define things like stat and alloca. */
+#define __STDC__ 0
+
+#include <direct.h> /* has stuff that should be in unistd.h */
+#include <wchar.h> /* needs to be included before our fixes below */
+
+#define lstat stat
+#define fsync _commit
+#define isnan _isnan
+#define finite _finite
+
+/* mkdir is missing the mode arg */
+#define mkdir(p,m) mkdir(p)
+
+typedef time_t time_t;
+struct tm;
+struct tm *my_localtime_r( const time_t *timep, struct tm *result );
+#define localtime_r my_localtime_r
+struct tm *my_gmtime_r( const time_t *timep, struct tm *result );
+#define gmtime_r my_gmtime_r
+void my_usleep( unsigned long usec );
+#define usleep my_usleep
+
+/* Missing stdint types: */
+#ifndef WIN32
+#include "stdint.h"
+#else
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef signed short int16_t;
+typedef unsigned short uint16_t;
+typedef int int32_t;
+typedef unsigned int uint32_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#endif
+static inline int64_t llabs( int64_t i ) { return i >= 0? i: -i; }
+
+#if defined(_MSC_VER)
+#pragma warning (disable : 4201) // nonstandard extension used : nameless struct/union (Windows headers do this)
+#pragma warning (disable : 4786) // turn off broken debugger warning
+#pragma warning (disable : 4512) // assignment operator could not be generated (so?)
+/* "unreachable code". This warning crops up in incorrect places (end of do ... while(0)
+ * blocks, try/catch blocks), and I've never found it to be useful. */
+#pragma warning (disable : 4702) // assignment operator could not be generated (so?)
+/* "unreferenced formal parameter"; we *want* that in many cases */
+#pragma warning (disable : 4100)
+/* "case 'aaa' is not a valid value for switch of enum 'bbb'
+ * Actually, this is a valid warning, but we do it all over the
+ * place, eg. with ScreenMessages. Those should be fixed, but later. XXX */
+#pragma warning (disable : 4063)
+#pragma warning (disable : 4127)
+#pragma warning (disable : 4786) /* VC6: identifier was truncated to '255' characters in the debug information */
+#pragma warning (disable : 4800) /* Forcing value to bool 'true' or 'false' - that's the whole point. Why warn us? */
+#endif
+
+#undef min
+#undef max
+#define NOMINMAX /* make sure Windows doesn't try to define this */
+
+/* Windows is missing some basic math functions: */
+#define NEED_TRUNCF
+#define NEED_ROUNDF
+#define NEED_STRTOF
+//our cross-platform stdint covers us here
+//#define MISSING_STDINT_H
+
+inline int lrintf( float f )
+{
+ int retval;
+
+ _asm fld f;
+ _asm fistp retval;
+
+ return retval;
+}
+
+/* For RageLog. */
+#define HAVE_VERSION_INFO
+
+/* We implement the crash handler interface (though that interface isn't completely
+ * uniform across platforms yet). */
+#if defined(_XBOX)
+ // no crash handler on Xbox
+#else
+# define CRASH_HANDLER
+#endif
+
+#define ENDIAN_LITTLE
+
+#if defined(XBOX)
+#include "ArchUtils/Xbox/arch_setup.h"
+#endif
+
+#define HAVE_BYTE_SWAPS
+
+inline uint32_t ArchSwap32( uint32_t n )
+{
+ __asm
+ {
+ mov eax, n
+ xchg al, ah
+ ror eax, 16
+ xchg al, ah
+ mov n, eax
+ };
+ return n;
+}
+
+inline uint32_t ArchSwap24( uint32_t n )
+{
+ __asm
+ {
+ mov eax, n
+ xchg al, ah
+ ror eax, 16
+ xchg al, ah
+ ror eax, 8
+ mov n, eax
+ };
+ return n;
+}
+
+inline uint16_t ArchSwap16( uint16_t n )
+{
+ __asm
+ {
+ mov ax, n
+ xchg al, ah
+ mov n, ax
+ };
+ return n;
+}
+
+#endif
+
+/*
+ * (c) 2002-2004 Glenn Maynard
+ * (c) 2008 BoXoRRoXoRs
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, and/or sell copies of the Software, and to permit persons to
+ * whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
+ * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
+ * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
+ * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */