diff options
author | Tom Schouten <doelie@users.sourceforge.net> | 2012-10-27 13:58:28 +0000 |
---|---|---|
committer | Tom Schouten <doelie@users.sourceforge.net> | 2012-10-27 13:58:28 +0000 |
commit | 201a9e763213f555d6797d0c6cad26a533fa75a5 (patch) | |
tree | 2fb38504fe5c029d731f23d35c8db95a553d7c8e /modules/extlib_util.h | |
parent | 99c67991f9a3c49485bc40b05f8ce85ecd838da5 (diff) |
creb: tabreadmix~ changes + build fixes + 32/64 bit fixes
svn path=/trunk/externals/creb/; revision=16491
Diffstat (limited to 'modules/extlib_util.h')
-rw-r--r-- | modules/extlib_util.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/extlib_util.h b/modules/extlib_util.h index 6261e39..e0a7bb3 100644 --- a/modules/extlib_util.h +++ b/modules/extlib_util.h @@ -23,6 +23,25 @@ #include <math.h> #include "m_pd.h" + +#define CT_NAMED_ASSERT(name,x) \ + typedef int _GENSYM(name ## _ctassert_)[-((x)==0)] +#define CT_ASSERT(x) CT_NAMED_ASSERT(,x) +#define _GENSYM(x) _CONCAT(x,__COUNTER__) +#define _CONCAT1(x,y) x##y +#define _CONCAT(x,y) _CONCAT1(x,y) + +/* Only defined in pd-extended. */ +#ifndef PD_FLOAT_PRECISION +#define PD_FLOAT_PRECISION 32 +#endif + +/* http://www.unix.org/version2/whatsnew/lp64_wp.html */ +typedef unsigned long long u64; +typedef unsigned int u32; +CT_ASSERT(sizeof(u32)==4); +CT_ASSERT(sizeof(u64)==8); + /* envelope stuff */ /* exponential range for envelopes is 60dB */ @@ -70,6 +89,7 @@ typedef union #define IS_DENORMAL(f) (((((t_flint)(f)).i[1]) & 0x7ff00000) == 0) #endif // endif PD_FLOAT_PRECISION + #else // if not defined(__i386__) || defined(__x86_64__) #define IS_DENORMAL(f) 0 #endif // end if defined(__i386__) || defined(__x86_64__) |