From 95a1abbcf3b29fc7387f2cf433c3c092d9f915de Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Fri, 19 Jan 2007 18:06:54 +0000 Subject: [PATCH] # 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. --- source/lib/debug.cpp | 9 ++++++--- source/sound/JSI_Sound.cpp | 2 +- source/sound/SoundGroupMgr.cpp | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/source/lib/debug.cpp b/source/lib/debug.cpp index c444ea779a..ce7fdc06c5 100644 --- a/source/lib/debug.cpp +++ b/source/lib/debug.cpp @@ -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]; diff --git a/source/sound/JSI_Sound.cpp b/source/sound/JSI_Sound.cpp index ed8c49d657..73fbd3a8b5 100644 --- a/source/sound/JSI_Sound.cpp +++ b/source/sound/JSI_Sound.cpp @@ -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); } diff --git a/source/sound/SoundGroupMgr.cpp b/source/sound/SoundGroupMgr.cpp index 401ee56abe..5bfcad1344 100644 --- a/source/sound/SoundGroupMgr.cpp +++ b/source/sound/SoundGroupMgr.cpp @@ -153,4 +153,4 @@ void CSoundGroupMgr::UpdateSoundGroups(float TimeSinceLastFrame) void CSoundGroupMgr::PlayNext(size_t index) { m_Groups[index]->PlayNext(); -} \ No newline at end of file +}