runtimelib: Disable debug code outside of debug builds

This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2019-01-17 16:56:26 +01:00
parent 7f5d100e51
commit ffccbd5907
3 changed files with 414 additions and 79 deletions
+404 -79
View File
File diff suppressed because it is too large Load Diff
+8
View File
@@ -48,6 +48,7 @@ static unsigned curr_clsColor;
static vector<GfxMode> gfx_modes;
#ifdef _DEBUG
static inline void debugImage(bbImage *i, int frame = 0) {
if (debug) {
if (!image_set.count(i)) ThrowRuntimeException("Image does not exist");
@@ -82,6 +83,13 @@ static inline void debugMode(int n) {
}
}
}
#else
#define debugImage
#define debugFont
#define debugCanvas
#define debugDriver
#define debugMode
#endif
void bbFreeImage(bbImage *i);
+2
View File
@@ -301,11 +301,13 @@ int bbCountHostIPs(BBStr *host) {
}
int bbHostIP(int index) {
#ifdef _DEBUG
if (debug) {
if (index<1 || index>host_ips.size()) {
ThrowRuntimeException("Host index out of range");
}
}
#endif
return host_ips[index - 1];
}