[PD-dev] [PD] more about float limitation

IOhannes m zmölnig zmoelnig at iem.at
Tue Feb 3 20:29:53 CET 2015


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20150203/0160a735/attachment.sig>


More information about the Pd-dev mailing list