On 11/14/07, jamie@postlude.co.uk jamie@postlude.co.uk wrote:
I also forgot to mention that if you don't have a float method implemented and this is used, that it will crash PD. I tried this out last night.
I can't reproduce that. using class_addfloat() to add an undefined method results in a compiler error, and omitting class_addfloat() results in Pd giving a "no method for 'float'" error to the Pd console. Using class_addanything() circumvents this by providing a catch-all handler.
What I meant was it crashes when you have no float method defined at all. And I thought that the 'anything' would catch it too, but it didn't on my machine, it crashed. Maybe it is just my machine, or system.
What system are you using?
Mike
On Wed, 2007-11-14 at 13:13 -0600, Mike McGonagle wrote:
What I meant was it crashes when you have no float method defined at all. And I thought that the 'anything' would catch it too, but it didn't on my machine, it crashed. Maybe it is just my machine, or system.
What system are you using?
I'm on a macbook pro dual boot Ubuntu Gutsy/ Mac OS X 10.4. An external built using the following code doesn't cause a crash in either OS, PD 0.39-3-extended or 0.40-3 vanilla:
#include "m_pd.h"
static t_class *nomethods_class;
typedef struct _nomethods { t_object x_obj; } t_nomethods;
static void *nomethods_new(t_symbol *s, t_int argc, t_atom *argv) { t_nomethods *x = (t_nomethods *)pd_new(nomethods_class);
return (x); }
void nomethods_setup(void) { nomethods_class = class_new(gensym("nomethods"), (t_newmethod)nomethods_new,0, sizeof(t_nomethods), 0, 0);
Jamie
I will try compiling this when I get home tonight, and let you know what happens. I am on an older Mac Laptop, running 10.4.10...
I also have a machine that is a desktop model, but I can't seem to get it to load any of the libraries. They will load properly when using PD 39, but the 40 stuff doesn't load the libraries. It is really strange because I use the exact same binary on my laptop, and it is fine...
Mike
On 11/14/07, Jamie Bullock jamie@postlude.co.uk wrote:
On Wed, 2007-11-14 at 13:13 -0600, Mike McGonagle wrote:
What I meant was it crashes when you have no float method defined at all. And I thought that the 'anything' would catch it too, but it didn't on my machine, it crashed. Maybe it is just my machine, or system.
What system are you using?
I'm on a macbook pro dual boot Ubuntu Gutsy/ Mac OS X 10.4. An external built using the following code doesn't cause a crash in either OS, PD 0.39-3-extended or 0.40-3 vanilla:
#include "m_pd.h"
static t_class *nomethods_class;
typedef struct _nomethods { t_object x_obj; } t_nomethods;
static void *nomethods_new(t_symbol *s, t_int argc, t_atom *argv) { t_nomethods *x = (t_nomethods *)pd_new(nomethods_class);
return (x);
}
void nomethods_setup(void) { nomethods_class = class_new(gensym("nomethods"), (t_newmethod)nomethods_new,0, sizeof(t_nomethods), 0, 0);
Jamie
-- www.postlude.co.uk