From 94099e035a7960312dccaef0ff0bb5bb1b2bd4db Mon Sep 17 00:00:00 2001 From: janwas Date: Sun, 14 Jan 2007 23:13:08 +0000 Subject: [PATCH] # housekeeping . add note to HAVE_C99 as per last meeting. . moved a few extern declarations to header (required for some code analysis tools) . tiny warning fix in SoundGroup This was SVN commit r4772. --- source/lib/config.h | 8 ++++++++ source/lib/debug.h | 2 ++ source/lib/mmgr.cpp | 2 -- source/lib/sysdep/win/wdbg.cpp | 7 +++---- source/lib/sysdep/win/wdbg_sym.cpp | 2 +- source/sound/SoundGroup.cpp | 2 +- 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/source/lib/config.h b/source/lib/config.h index bf801452f3..cfa171db8e 100644 --- a/source/lib/config.h +++ b/source/lib/config.h @@ -285,6 +285,14 @@ // compiler support for C99 // (this is more convenient than testing __STDC_VERSION__ directly) +// note: we currently lie about __STDC_VERSION__ via premake on +// MacOS X to enable support for some C99 functions. unfortunately this +// causes the OS X system headers to use the restrict keyword, which +// gcc doesn't actually support there. +// TODO: we therefore need to get rid of HAVE_C99, since we're using C++, +// which is not C99. some useful features from C99 - e.g. stdint and +// restrict - will surely be added to C++; we should test for their +// existence and not all of C99. #define HAVE_C99 0 #ifdef __STDC_VERSION__ # if __STDC_VERSION__ >= 199901L diff --git a/source/lib/debug.h b/source/lib/debug.h index b8d7e1fcc7..8b32dddb9c 100644 --- a/source/lib/debug.h +++ b/source/lib/debug.h @@ -577,6 +577,8 @@ extern LibError debug_resolve_symbol(void* ptr_of_interest, char* sym_name, char **/ extern LibError debug_dump_stack(wchar_t* buf, size_t max_chars, uint skip, void* context); +extern const char* debug_get_symbol_string(void* symbol, const char* name, const char* file, int line); + //----------------------------------------------------------------------------- // helper functions (used by implementation) diff --git a/source/lib/mmgr.cpp b/source/lib/mmgr.cpp index 158b4efce9..d1519c6d32 100644 --- a/source/lib/mmgr.cpp +++ b/source/lib/mmgr.cpp @@ -130,8 +130,6 @@ uint mmgr_set_options(uint new_options) // string formatting routines for log and reports ////////////////////////////////////////////////////////////////////////////// -extern const char* debug_get_symbol_string(void* symbol, const char* name, const char* file, int line); - const size_t NUM_SIZE = 32; // enough to cover even 64 bit numbers diff --git a/source/lib/sysdep/win/wdbg.cpp b/source/lib/sysdep/win/wdbg.cpp index bc444ada8d..6069b1786c 100644 --- a/source/lib/sysdep/win/wdbg.cpp +++ b/source/lib/sysdep/win/wdbg.cpp @@ -34,6 +34,8 @@ #include "lib/sysdep/cpu.h" #include "win_internal.h" +#include "wdbg_sym.h" + #pragma SECTION_PRE_LIBC(D) WIN_REGISTER_FUNC(wdbg_init); @@ -660,9 +662,6 @@ static void get_exception_locus(const EXCEPTION_POINTERS* ep, // - a new fat exception class would have to be created to hold the // SEH exception information (e.g. CONTEXT for a stack trace), and // - this information would not be available for C++ exceptions. - -extern void wdbg_write_minidump(EXCEPTION_POINTERS* ep); - LONG WINAPI wdbg_exception_filter(EXCEPTION_POINTERS* ep) { // note: we risk infinite recursion if someone raises an SEH exception @@ -687,7 +686,7 @@ LONG WINAPI wdbg_exception_filter(EXCEPTION_POINTERS* ep) // this must happen before the error dialog because user could choose to // exit immediately there. - wdbg_write_minidump(ep); + wdbg_sym_write_minidump(ep); wchar_t buf[500]; const wchar_t* msg_fmt = diff --git a/source/lib/sysdep/win/wdbg_sym.cpp b/source/lib/sysdep/win/wdbg_sym.cpp index 2db9580543..fcbb2460ac 100644 --- a/source/lib/sysdep/win/wdbg_sym.cpp +++ b/source/lib/sysdep/win/wdbg_sym.cpp @@ -1896,7 +1896,7 @@ LibError debug_dump_stack(wchar_t* buf, size_t max_chars, uint skip, void* pcont // examining the crash in a debugger. called by wdbg_exception_filter. // heavily modified from http://www.codeproject.com/debug/XCrashReportPt3.asp // lock must be held. -void wdbg_write_minidump(EXCEPTION_POINTERS* exception_pointers) +void wdbg_sym_write_minidump(EXCEPTION_POINTERS* exception_pointers) { lock(); diff --git a/source/sound/SoundGroup.cpp b/source/sound/SoundGroup.cpp index 417b712447..0b57849ff6 100644 --- a/source/sound/SoundGroup.cpp +++ b/source/sound/SoundGroup.cpp @@ -89,7 +89,7 @@ void CSoundGroup::PlayNext() { // try loading on the fly only when we need the sound to see if that fixes release problems... if(TestFlag(eRandOrder)) - m_index = (size_t)rand(0, filenames.size()); + m_index = (size_t)rand(0, (uint)filenames.size()); Handle temp; temp = snd_open(m_filepath + filenames[m_index]); snd_set_gain(temp, m_Gain);