Don't try to define __try/__except on non-MSVC systems

They didn't do anything anyway, and can clash with other compilers since they
may be used internally (macros and keywords starting with __ are for compiler
use).
This commit is contained in:
Chris Robinson 2016-04-26 05:55:18 -07:00
parent 172290224b
commit 204d0c8572
4 changed files with 15 additions and 26 deletions

View file

@ -23,19 +23,6 @@ inline int CheckException(DWORD code)
return EXCEPTION_CONTINUE_SEARCH; return EXCEPTION_CONTINUE_SEARCH;
} }
#else
#ifdef __try
#undef __try
#endif
#define __try
#ifdef __except
#undef __except
#endif
#define __except(a) if (0)
#endif #endif
#endif #endif

View file

@ -3192,8 +3192,8 @@ bool IsFModExPresent()
{ {
#ifdef NO_FMOD #ifdef NO_FMOD
return false; return false;
#elif !defined _WIN32 #elif !defined _MSC_VER
return true; // on non-Windows we cannot delay load the library so it has to be present. return true; // on non-MSVC we cannot delay load the library so it has to be present.
#else #else
static bool cached_result; static bool cached_result;
static bool done = false; static bool done = false;

View file

@ -56,17 +56,18 @@ bool MPG123Decoder::open(FileReader *reader)
{ {
if(!inited) if(!inited)
{ {
__try #ifdef _MSC_VER
{ __try {
#endif
if(mpg123_init() != MPG123_OK) if(mpg123_init() != MPG123_OK)
return false; return false;
inited = true; inited = true;
} #ifdef _MSC_VER
__except (CheckException(GetExceptionCode())) } __except (CheckException(GetExceptionCode())) {
{
// this means that the delay loaded decoder DLL was not found. // this means that the delay loaded decoder DLL was not found.
return false; return false;
} }
#endif
} }
Reader = reader; Reader = reader;

View file

@ -54,8 +54,9 @@ SndFileDecoder::~SndFileDecoder()
bool SndFileDecoder::open(FileReader *reader) bool SndFileDecoder::open(FileReader *reader)
{ {
__try #ifdef _MSC_VER
{ __try {
#endif
SF_VIRTUAL_IO sfio = { file_get_filelen, file_seek, file_read, file_write, file_tell }; SF_VIRTUAL_IO sfio = { file_get_filelen, file_seek, file_read, file_write, file_tell };
Reader = reader; Reader = reader;
@ -68,11 +69,11 @@ bool SndFileDecoder::open(FileReader *reader)
sf_close(SndFile); sf_close(SndFile);
SndFile = 0; SndFile = 0;
} }
} #ifdef _MSC_VER
__except (CheckException(GetExceptionCode())) } __except (CheckException(GetExceptionCode())) {
{
// this means that the delay loaded decoder DLL was not found. // this means that the delay loaded decoder DLL was not found.
} }
#endif
return false; return false;
} }