X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Flib%2F_all.inc;h=c5e020660d3980f5f029bf97af8112b17603f6f6;hb=537313c9e52ce93b28ad6580b76e92d99f0a9d93;hp=9aaf524493719d0171363d086cfd29db0944bf05;hpb=e8ab5cb157b6c4fee13e739b09df83e73f5dfbee;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/lib/_all.inc b/qcsrc/lib/_all.inc index 9aaf52449..c5e020660 100644 --- a/qcsrc/lib/_all.inc +++ b/qcsrc/lib/_all.inc @@ -25,15 +25,43 @@ #include #endif +#define USING(name, T) typedef T name + +#include "bool.qh" +#include "int.qh" + #include "macro.qh" +#if NDEBUG + #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); \ + isnt_##T(sym); \ + } \ + 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)); } + #include "warpzone/mathlib.qc" #include "accumulate.qh" #include "angle.qc" #include "arraylist.qh" #include "bits.qh" -#include "bool.qh" #include "color.qh" #include "counting.qh" #include "cvar.qh" @@ -43,8 +71,8 @@ #include "file.qh" #include "functional.qh" #include "i18n.qh" -#include "int.qh" #include "iter.qh" +#include "json.qc" #include "lazy.qh" #include "linkedlist.qh" #include "log.qh" @@ -75,3 +103,5 @@ #include "urllib.qc" #include "vector.qh" #include "yenc.qh" + +#include "matrix/_mod.inc"