Make PCSX2 compile with Visual Studio 2012 (1/3): Workaround compiler differences that result in compile-time errors.

NOTE: The 'glew' project does NOT build yet, but it will have to be decided how to approach the problem (String literal too long in glew.rc)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5382 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gigaherz 2012-08-19 19:36:59 +00:00
parent e650a1d8a0
commit 72372c2219
7 changed files with 27 additions and 11 deletions

View File

@ -56,7 +56,7 @@
#include "pa_win_wdmks_utils.h" #include "pa_win_wdmks_utils.h"
#if !defined(PA_WDMKS_NO_KSGUID_LIB) && !defined(PAWIN_WDMKS_NO_KSGUID_LIB) #if !defined(PA_WDMKS_NO_KSGUID_LIB) && !defined(PAWIN_WDMKS_NO_KSGUID_LIB)
#if (defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1200))) /* MSC version 6 and above */ #if (defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1200) && (_MSC_VER < 1600))) /* MSC version 6 up to 2008 */
#pragma comment( lib, "ksguid.lib" ) #pragma comment( lib, "ksguid.lib" )
#endif #endif
#define pa_KSDATAFORMAT_TYPE_AUDIO KSDATAFORMAT_TYPE_AUDIO #define pa_KSDATAFORMAT_TYPE_AUDIO KSDATAFORMAT_TYPE_AUDIO

View File

@ -649,7 +649,6 @@ extern "C"
# include <process.h> # include <process.h>
#endif #endif
static INLINE void* _InterlockedExchangePointer( void* volatile* target, void* value ) static INLINE void* _InterlockedExchangePointer( void* volatile* target, void* value )
{ {
#ifdef _M_AMD64 // high-level atomic ops, please leave these 64 bit checks in place. #ifdef _M_AMD64 // high-level atomic ops, please leave these 64 bit checks in place.
@ -659,6 +658,7 @@ static INLINE void* _InterlockedExchangePointer( void* volatile* target, void* v
#endif #endif
} }
#if _MSC_VER < 1700
static INLINE void* _InterlockedCompareExchangePointer( void* volatile* target, void* value, void* comparand ) static INLINE void* _InterlockedCompareExchangePointer( void* volatile* target, void* value, void* comparand )
{ {
#ifdef _M_AMD64 // high-level atomic ops, please leave these 64 bit checks in place. #ifdef _M_AMD64 // high-level atomic ops, please leave these 64 bit checks in place.
@ -667,6 +667,7 @@ static INLINE void* _InterlockedCompareExchangePointer( void* volatile* target,
return (void*)_InterlockedCompareExchange( (LONG_PTR*)target, (LONG_PTR)value, (LONG_PTR)comparand ); return (void*)_InterlockedCompareExchange( (LONG_PTR*)target, (LONG_PTR)value, (LONG_PTR)comparand );
#endif #endif
} }
#endif
static INLINE void* _InterlockedExchangeAddPointer( void* volatile* target, void* value ) static INLINE void* _InterlockedExchangeAddPointer( void* volatile* target, void* value )
{ {

View File

@ -93,7 +93,7 @@ enum wxKeyType
#define WX_DECLARE_LIST_WITH_DECL(elT, liT, decl) \ #define WX_DECLARE_LIST_WITH_DECL(elT, liT, decl) \
WX_DECLARE_LIST_XO(elT*, liT, decl) WX_DECLARE_LIST_XO(elT*, liT, decl)
#if !defined( __VISUALC__ ) #if (defined(_MSC_VER) && _MSC_VER >= 1300) || !defined( __VISUALC__ )
template<class T> template<class T>
class WXDLLIMPEXP_BASE wxList_SortFunction class WXDLLIMPEXP_BASE wxList_SortFunction
@ -109,8 +109,17 @@ private:
#define WX_LIST_SORTFUNCTION( elT, f ) wxList_SortFunction<elT>(f) #define WX_LIST_SORTFUNCTION( elT, f ) wxList_SortFunction<elT>(f)
#define VC6_WORKAROUND(elT, liT, decl) #define VC6_WORKAROUND(elT, liT, decl)
#if defined(_MSC_VER) && _MSC_VER >= 1700
#define WXObjectAllocator(x) std::_Wrap_alloc< wxObjectAllocator< x > >
#else
#define WXObjectAllocator(x) wxObjectAllocator< x >
#endif
#else // if defined( __VISUALC__ ) #else // if defined( __VISUALC__ )
#define WXObjectAllocator(x) wxObjectAllocator< x >
#define WX_LIST_SORTFUNCTION( elT, f ) std::greater<elT>( f ) #define WX_LIST_SORTFUNCTION( elT, f ) std::greater<elT>( f )
#define VC6_WORKAROUND(elT, liT, decl) \ #define VC6_WORKAROUND(elT, liT, decl) \
decl liT; \ decl liT; \
@ -174,10 +183,10 @@ private:
}; \ }; \
\ \
VC6_WORKAROUND(elT, liT, decl) \ VC6_WORKAROUND(elT, liT, decl) \
decl liT : public std::list< elT, wxObjectAllocator< elT > > \ decl liT : public std::list< elT, WXObjectAllocator( elT ) > \
{ \ { \
private: \ private: \
typedef std::list< elT, wxObjectAllocator< elT > > BaseListType; \ typedef std::list< elT, WXObjectAllocator( elT ) > BaseListType; \
static BaseListType EmptyList; \ static BaseListType EmptyList; \
\ \
bool m_destroy; \ bool m_destroy; \
@ -187,7 +196,7 @@ private:
{ \ { \
private: \ private: \
/* Workaround for broken VC6 nested class name resolution */ \ /* Workaround for broken VC6 nested class name resolution */ \
typedef std::list<elT, wxObjectAllocator< elT > >::iterator iterator; \ typedef std::list<elT, WXObjectAllocator( elT ) >::iterator iterator; \
friend class liT; \ friend class liT; \
\ \
iterator m_iter; \ iterator m_iter; \

View File

@ -107,8 +107,10 @@
#endif #endif
#if !defined __WXWINCE__ && !defined NEED_PBT_H #if !defined __WXWINCE__ && !defined NEED_PBT_H
#if !defined(_MSC_VER) || _MSC_VER < 1600
#include <pbt.h> #include <pbt.h>
#endif #endif
#endif
#if defined(__WXWINCE__) #if defined(__WXWINCE__)
#include "wx/msw/wince/missing.h" #include "wx/msw/wince/missing.h"

View File

@ -58,7 +58,7 @@ public:
}; };
#ifdef _MSC_VER #ifdef _MSC_VER
typedef std::list< wxEvent*, wxObjectAllocator<wxEvent*> > wxEventList; typedef std::list< wxEvent*, WXObjectAllocator(wxEvent*) > wxEventList;
#else #else
typedef std::list< wxEvent* > wxEventList; typedef std::list< wxEvent* > wxEventList;
#endif #endif

View File

@ -172,7 +172,7 @@ protected:
}; };
#ifdef _MSC_VER #ifdef _MSC_VER
typedef std::list< SysExecEvent*, wxObjectAllocator<SysExecEvent*> > pxEvtList; typedef std::list< SysExecEvent*, WXObjectAllocator(SysExecEvent*) > pxEvtList;
#else #else
typedef std::list<SysExecEvent*> pxEvtList; typedef std::list<SysExecEvent*> pxEvtList;
#endif #endif

View File

@ -103,12 +103,16 @@ typedef signed long long int64;
using namespace std; using namespace std;
#if defined(_MSC_VER) && _MSC_VER >= 1500 && _MSC_VER < 1600 #ifdef _MSC_VER
#if _MSC_VER >= 1500
#include <memory> #include <memory>
#if _MSC_VER < 1600
using namespace std::tr1; using namespace std::tr1;
#else
using namespace std;
#endif
#endif
#endif #endif
#ifdef __GNUC__ #ifdef __GNUC__