move some Win32-specific config stuff where it belongs

move defines
simplify
This commit is contained in:
Glenn Maynard
2003-04-20 22:05:13 +00:00
parent 94e6cc79e7
commit 862421014e
+19 -49
View File
@@ -19,25 +19,11 @@
#define VC_EXTRALEAN // Exclude rarely-used stuff
#if defined(_MSC_VER) && (_MSC_VER > 1100)
#pragma warning (disable : 4786) // turn off broken debugger warning
#pragma warning (disable : 4512) // 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 */
/* Platform-specific fixes. */
#if defined(WIN32)
#include "archutils/Win32/arch_setup.h"
#endif
#undef min
#undef max
#define NOMINMAX /* make sure Windows doesn't try to define this */
/* Make sure everyone has min and max: */
#include <algorithm>
@@ -47,6 +33,18 @@
/* And vector: */
#include <vector>
#if defined(NEED_MINMAX_TEMPLATES)
/* Some old <algorithm>s don't actually define min and max. */
template<class T>
inline const T& max(const T &a, const T &b) { return a < b? b:a; }
template<class T, class P>
inline const T& max(const T &a, const T &b, P Pr) { return Pr(a, b)? b:a; }
template<class T>
inline const T& min(const T &a, const T &b) { return b < a? b:a; }
template<class T, class P>
inline const T& min(const T &a, const T &b, P Pr) { return Pr(b, a)? b:a; }
#endif
using namespace std;
#ifdef ASSERT
@@ -61,15 +59,14 @@ using namespace std;
#include "archutils/win32/crash.h"
#define RAGE_ASSERT_M(COND, MESSAGE) { if(!(COND)) { VDCHECKPOINT_M(MESSAGE); *(char*)0=0; } }
#define RAGE_ASSERT(COND) RAGE_ASSERT_M((COND), "Assertion '" #COND "' failed")
/* Make this the default assert handler. */
#define ASSERT RAGE_ASSERT
#else
#include <assert.h>
/* TODO: define RAGE_ASSERT* (nothing actually uses those right now) */
#define ASSERT assert
/* TODO: do something useful and portable with RAGE_ASSERT*. */
#define RAGE_ASSERT_M(COND, MESSAGE) ASSERT(COND)
#define RAGE_ASSERT(COND) RAGE_ASSERT_M((COND), "Assertion '" #COND "' failed")
#define ASSERT assert
#endif
/* Define a macro to tell the compiler that a function doesn't return. This just
@@ -86,38 +83,12 @@ using namespace std;
/* Use CStdString: */
#include "StdString.h"
#define CString CStdString
#if defined(_MSC_VER) && _MSC_VER < 1300 /* VC6, not VC7 */
/* VC6's <algorithm> is doesn't actually define min and max. */
template<class T>
inline const T& max(const T &a, const T &b)
{ return a < b? b:a; }
template<class T, class P>
inline const T& max(const T &a, const T &b, P Pr)
{ return Pr(a, b)? b:a; }
template<class T>
inline const T& min(const T &a, const T &b)
{ return b < a? b:a; }
template<class T, class P>
inline const T& min(const T &a, const T &b, P Pr)
{ return Pr(b, a)? b:a; }
#endif
#define CStringArray vector<CString>
/* Include this here to make sure our assertion handler is always
* used. (This file is a dependency of most everything anyway,
* so there's no real problem putting it here.) */
#include "RageException.h"
/* Platform-specific fixes. */
#if defined(WIN32)
#include "archutils/Win32/arch_setup.h"
#endif
#if !defined(WIN32)
#define stricmp strcasecmp
#define strnicmp strncasecmp
@@ -147,7 +118,6 @@ inline const T& min(const T &a, const T &b, P Pr)
#endif
#endif
/* Don't include our own headers here, since they tend to change
* often. */
/* Don't include our own headers here, since they tend to change often. */
#endif