- added stack trace for windows users when exceptions occur (snagged the idea from sauerbraten)
This commit is contained in:
parent
7c47a51718
commit
8ab95a5305
|
@ -107,6 +107,8 @@ public:
|
|||
static const char *RANDOMFACTION_SLOTNAME;
|
||||
|
||||
static const char *playerTextureCacheLookupKey;
|
||||
|
||||
static const char *application_name;
|
||||
};
|
||||
|
||||
enum PathType {
|
||||
|
|
|
@ -45,7 +45,8 @@ const char *GameConstants::folder_path_screenshots = "screens/";
|
|||
const char *GameConstants::OBSERVER_SLOTNAME = "*Observer*";
|
||||
const char *GameConstants::RANDOMFACTION_SLOTNAME = "*Random*";
|
||||
|
||||
const char *GameConstants::playerTextureCacheLookupKey = "playerTextureCache";
|
||||
const char *GameConstants::playerTextureCacheLookupKey = "playerTextureCache";
|
||||
const char *GameConstants::application_name = "MegaGlest";
|
||||
|
||||
// =====================================================
|
||||
// class Config
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -54,6 +54,37 @@ string getCommandLine();
|
|||
void init_win32();
|
||||
void done_win32();
|
||||
|
||||
|
||||
// The following is used for stacking tracing for windows based exceptions
|
||||
#if defined(WIN32) && !defined(_DEBUG) && !defined(__GNUC__)
|
||||
|
||||
// easy safe strings
|
||||
#define MAXSTRLEN 260
|
||||
typedef char stringType[MAXSTRLEN];
|
||||
|
||||
inline void vformatstring(char *d, const char *fmt, va_list v, int len = MAXSTRLEN) { _vsnprintf(d, len, fmt, v); d[len-1] = 0; }
|
||||
inline char *copystring(char *d, const char *s, size_t len = MAXSTRLEN) { strncpy(d, s, len); d[len-1] = 0; return d; }
|
||||
inline char *concatstring(char *d, const char *s, size_t len = MAXSTRLEN) { size_t used = strlen(d); return used < len ? copystring(d+used, s, len-used) : d; }
|
||||
|
||||
struct stringformatter
|
||||
{
|
||||
char *buf;
|
||||
stringformatter(char *buf): buf((char *)buf) {}
|
||||
void operator()(const char *fmt, ...)
|
||||
{
|
||||
va_list v;
|
||||
va_start(v, fmt);
|
||||
vformatstring(buf, fmt, v);
|
||||
va_end(v);
|
||||
}
|
||||
};
|
||||
|
||||
#define formatstring(d) stringformatter((char *)d)
|
||||
#define defformatstring(d) stringType d; formatstring(d)
|
||||
#define defvformatstring(d,last,fmt) stringType d; { va_list ap; va_start(ap, last); vformatstring(d, fmt, ap); va_end(ap); }
|
||||
|
||||
#endif
|
||||
|
||||
}}//end namespace
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue