X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Flib%2F_all.inc;h=0fee57ec18e87aac641444bd8d424cb82afa106c;hb=834fed09016056ff2cd32d1980f0719d09c403a2;hp=97d560b5c4708542a199781e853fa87b2b99af1d;hpb=e9815ad279dc61506e5e65c34348fa7dcc570b9e;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/lib/_all.inc b/qcsrc/lib/_all.inc index 97d560b5c..0fee57ec1 100644 --- a/qcsrc/lib/_all.inc +++ b/qcsrc/lib/_all.inc @@ -25,6 +25,8 @@ #include #endif +#define USING(name, T) typedef T name + #include "bool.qh" #include "int.qh" @@ -34,16 +36,25 @@ #define TC(T, sym) MACRO_BEGIN MACRO_END #else #define TC(T, sym) MACRO_BEGIN \ - if (!is_##T(sym)) LOG_WARNINGF("Type check failed: " #sym " :: " #T); \ + if (!is_##T(sym)) { \ + LOG_WARNINGF("Type check failed: " #sym " :: " #T); \ + isnt_##T(sym); \ + } \ MACRO_END #endif -bool is_float (float this) { return true; } -bool is_vector(vector this) { return true; } -bool is_string(string this) { return true; } -bool is_entity(entity this) { return true; } -bool is_int (float this) { return this == floor(this); } -bool is_bool (float this) { return this == true || this == false; } +#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)); } #include "warpzone/mathlib.qc"