On 02/03/2015 08:16 PM, IOhannes m zmölnig wrote:
EXTERN t_class *class_new32(...) EXTERN t_class *class_new64(...)
this btw, would also allow to write externals that provide both single- and double-prevision versions of an objectclass, without the need to change the extension.
however, it is not as straightforward as in the "fat" case, where you just glue together multiple (potentially unrelated) binaries of different archs, and the dynamic linker (the OS!) decides which one to use.
something like:
<myclass32.c> #define PD_FLOATSIZE 32 #include <m_pd.h> #include "myclass_impl.c" void myclass_setup32(void) { class_new32(gensym("myclass"),...); } </myclass32.c> <myclass64.c> #define PD_FLOATSIZE 64 #include <m_pd.h> #include "myclass_impl.c" void myclass_setup32(void) { class_new64(gensym("myclass"),...); } </myclass64.c> <myclass.c> void myclass_setup(void) { #ifdef PD_FLOATSIZE == 64 myclass_setup64(); #else myclass_setup32(); #endif } </myclass.c>
it's probably possible to all this in a single wrapper file, but i hope it's easier to understand without preprocessor magic.
gfmdsar IOhannes