# Fixed Linux build

Forgot that you can't initialise std::exception with a message.
Fixed invalid goto jumping over declarations that aren't POD types with
no initialiser.

This was SVN commit r4793.
This commit is contained in:
Ykkrosh 2007-01-19 18:06:54 +00:00
parent 153e607006
commit 95a1abbcf3
3 changed files with 8 additions and 5 deletions

View File

@ -568,7 +568,8 @@ const wchar_t* debug_error_message_build(
// append stack trace
if(!context)
skip += 2; // skip debug_error_message_build and debug_display_error
LibError ret = debug_dump_stack(pos, chars_left, skip, context);
LibError ret;
ret = debug_dump_stack(pos, chars_left, skip, context);
if(ret == ERR::REENTERED)
{
len = swprintf(pos, chars_left,
@ -594,8 +595,10 @@ const wchar_t* debug_error_message_build(
// append OS error (just in case it happens to be relevant -
// it's usually still set from unrelated operations)
char description_buf[100] = {'?'};
LibError errno_equiv = LibError_from_errno(false);
char description_buf[100];
strcpy(description_buf, "?"); // can't use an initialiser in the declaration, because goto is not allowed to jump over them
LibError errno_equiv;
errno_equiv = LibError_from_errno(false);
if(errno_equiv != ERR::FAIL) // meaningful translation
error_description_r(errno_equiv, description_buf, ARRAY_SIZE(description_buf));
char os_error[100];

View File

@ -24,7 +24,7 @@ JSI_Sound::JSI_Sound(const CStr& Filename)
// report errors, since we're in the ctor and don't want to move
// the open call elsewhere (by requiring an explicit open() call).
if (m_Handle < 0)
throw std::exception("sound load failed"); // caught by JSI_Sound::Construct.
throw std::exception(); // caught by JSI_Sound::Construct.
snd_set_pos(m_Handle, 0,0,0, true);
}

View File

@ -153,4 +153,4 @@ void CSoundGroupMgr::UpdateSoundGroups(float TimeSinceLastFrame)
void CSoundGroupMgr::PlayNext(size_t index)
{
m_Groups[index]->PlayNext();
}
}