I mean this works fine on linux and windows single-precision but this single-precision lib crashes Pd-double in win and linux.


?

Mensaje telepatico asistido por maquinas.
On 12/10/19 7:50 PM, Lucas Cordiviola wrote:
Ok. So why do I get a segfault on linux and a crash on windows

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

void pddplink_setup(void)

{

t_symbol *dirsym;

pddplink_class = class_new(gensym("pddplink"),

(t_newmethod)pddplink_new,

(t_method)pddplink_free,

sizeof(t_pddplink),

CLASS_NOINLET | CLASS_PATCHABLE,

A_GIMME, 0);

class_addanything(pddplink_class, pddplink_anything);

class_setwidget(pddplink_class, &pddplink_widgetbehavior);

pddplinkbox_class = class_new(gensym("pddplink"), 0,

(t_method)pddplink_free,

sizeof(t_pddplink), 0, A_GIMME, 0);

class_addbang(pddplinkbox_class, pddplink_bang);

class_addanything(pddplinkbox_class, pddplink_anything);

class_addmethod(pddplinkbox_class, (t_method)pddplink_click,

gensym("click"),

A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);

dirsym = pddplink_class->c_externdir; /* FIXME */

sys_vgui("source {%s/pddplink.tcl}\n", dirsym->s_name);

}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



?

Mensaje telepatico asistido por maquinas.

On 12/10/19 7:45 PM, Christof Ressi wrote:
Is this: "A_FLOAT" forbidden?
I'm not sure what you mean exactly, but A_FLOAT is an atom type, so 
it's 100% unrelated to single/double precision.
*Gesendet:* Dienstag, 10. Dezember 2019 um 23:37 Uhr
*Von:* "Lucas Cordiviola" <lucarda27@hotmail.com>
*An:* "pd-dev@lists.iem.at" <pd-dev@lists.iem.at>
*Betreff:* Re: [PD-dev] Double precision externals extensions.

Is this: "A_FLOAT" forbidden?

~~~~~

void pddplink_setup(void)

{

t_symbol *dirsym;

pddplink_class = class_new(gensym("pddplink"),

(t_newmethod)pddplink_new,

(t_method)pddplink_free,

sizeof(t_pddplink),

CLASS_NOINLET | CLASS_PATCHABLE,

A_GIMME, 0);

class_addanything(pddplink_class, pddplink_anything);

class_setwidget(pddplink_class, &pddplink_widgetbehavior);

pddplinkbox_class = class_new(gensym("pddplink"), 0,

(t_method)pddplink_free,

sizeof(t_pddplink), 0, A_GIMME, 0);

class_addbang(pddplinkbox_class, pddplink_bang);

class_addanything(pddplinkbox_class, pddplink_anything);

class_addmethod(pddplinkbox_class, (t_method)pddplink_click,

gensym("click"),

A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);

dirsym = pddplink_class->c_externdir; /* FIXME */

sys_vgui("source {%s/pddplink.tcl}\n", dirsym->s_name);

}

~~~~~

Mensaje telepatico asistido por maquinas.
On 12/10/19 7:30 PM, Lucas Cordiviola wrote:

    I get the segfault on linux (it also crashes Pd-double)

    ~~~~~~~~~~~

    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff6170e93 in pddplink_setup ()
       from
    /home/lucarda/Desktop/luclibdep/00-lucarda-external-dep/out64single/lucdep/liblucdep.so

    ~~~~~~~~~~~~~~~


    :)


    Mensaje telepatico asistido por maquinas.

    On 12/10/19 7:06 PM, IOhannes m zmölnig wrote:

        On 12/10/19 10:48 PM, Christof Ressi wrote:

            I'm also interested in how this works. The following
            solution popped up in my head: compile the object twice,
            one time with -DPD_FLOATSIZE=32 and another time with
            -DPD_FLOATSIZE=64, with different setup functions based on
            -DPD_FLOATSIZE, then link it with a third file which
            exports the "real" setup function (which calls the other
            two private setup functions).

        that's about the idea.

        gdsa r
        IOhannes


        _______________________________________________
        Pd-dev mailing list
        Pd-dev@lists.iem.at
        https://lists.puredata.info/listinfo/pd-dev

_______________________________________________ Pd-dev mailing list 
Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev

_______________________________________________
Pd-dev mailing list
Pd-dev@lists.iem.at
https://lists.puredata.info/listinfo/pd-dev
_______________________________________________
Pd-dev mailing list
Pd-dev@lists.iem.at
https://lists.puredata.info/listinfo/pd-dev