From 00dbdb9c65e604641bf6987deba5110463e5ae3d Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 19 Jun 2017 01:09:10 +0200 Subject: [PATCH] If debug isn't enabled (-DNDEBUG=1) don't create 2 unused functions/macros for each variable type --- qcsrc/lib/_all.inc | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/qcsrc/lib/_all.inc b/qcsrc/lib/_all.inc index 136c4e7f6..b8d78cd04 100644 --- a/qcsrc/lib/_all.inc +++ b/qcsrc/lib/_all.inc @@ -61,18 +61,20 @@ MACRO_END #endif -#define is_float(this) (true || ftoe(this)) -#define isnt_float(this) -#define is_vector(this) (true || vtos(this)) -#define isnt_vector(this) -#define is_string(this) (true || stof(this)) -#define isnt_string(this) -#define is_entity(this) (true || etof(this)) -#define isnt_entity(this) -bool is_int(float this) { return this == floor(this); } -void isnt_int(float this) { print(ftos(this)); } -bool is_bool(float this) { return this == true || this == false; } -void isnt_bool(float this) { print(ftos(this)); } +#if !(NDEBUG) + #define is_float(this) (true || ftoe(this)) + #define isnt_float(this) + #define is_vector(this) (true || vtos(this)) + #define isnt_vector(this) + #define is_string(this) (true || stof(this)) + #define isnt_string(this) + #define is_entity(this) (true || etof(this)) + #define isnt_entity(this) + bool is_int(float this) { return this == floor(this); } + void isnt_int(float this) { print(ftos(this)); } + bool is_bool(float this) { return this == true || this == false; } + void isnt_bool(float this) { print(ftos(this)); } +#endif #include "warpzone/mathlib.qc" -- 2.39.2