From 201a9e763213f555d6797d0c6cad26a533fa75a5 Mon Sep 17 00:00:00 2001 From: Tom Schouten Date: Sat, 27 Oct 2012 13:58:28 +0000 Subject: creb: tabreadmix~ changes + build fixes + 32/64 bit fixes svn path=/trunk/externals/creb/; revision=16491 --- modules/extlib_util.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'modules/extlib_util.h') 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 #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__) -- cgit v1.2.1