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;
}
#else
#ifdef __try
#undef __try
#endif
#define __try
#ifdef __except
#undef __except
#endif
#define __except(a) if (0)
#endif
#endif
#endif

View file

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

View file

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

View file

@ -54,8 +54,9 @@ SndFileDecoder::~SndFileDecoder()
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 };
Reader = reader;
@ -68,11 +69,11 @@ bool SndFileDecoder::open(FileReader *reader)
sf_close(SndFile);
SndFile = 0;
}
}
__except (CheckException(GetExceptionCode()))
{
#ifdef _MSC_VER
} __except (CheckException(GetExceptionCode())) {
// this means that the delay loaded decoder DLL was not found.
}
#endif
return false;
}