From 0862b5b9f29605239e9ae5ebd4088f9887f5b426 Mon Sep 17 00:00:00 2001 From: Jonathan Wilkes <jon.w.wilkes@gmail.com> Date: Tue, 18 Jul 2017 17:33:52 -0400 Subject: [PATCH] add "platform" method to [pdinfo] --- pd/src/x_interface.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pd/src/x_interface.c b/pd/src/x_interface.c index d3ba2a6df..bbff948b9 100644 --- a/pd/src/x_interface.c +++ b/pd/src/x_interface.c @@ -843,6 +843,26 @@ void pdinfo_libdir(t_pdinfo *x, t_symbol *s, int argc, t_atom *argv) info_out((t_text *)x, s, 1, at); } +void pdinfo_platform(t_pdinfo *x, t_symbol *s, int argc, t_atom *argv) +{ + t_atom at[1]; + t_symbol *p = gensym("unknown"); +#ifdef __APPLE__ + p = gensym("darwin"); +#endif +#ifdef __FreeBSD__ + p = gensym("freebsd"); +#endif +#ifdef _WIN32 + p = gensym("win32"); +#endif +#ifdef __linux__ + p = gensym("linux"); +#endif + SETSYMBOL(at, p); + info_out((t_text *)x, s, 1, at); +} + void pdinfo_version(t_pdinfo *x, t_symbol *s, int argc, t_atom *argv) { int major=0, minor=0, bugfix=0; @@ -930,6 +950,8 @@ void pdinfo_setup(void) gensym("midi-outdev"), A_GIMME, 0); class_addmethod(pdinfo_class, (t_method)pdinfo_midi_listdevs, gensym("midi-outdevlist"), A_GIMME, 0); + class_addmethod(pdinfo_class, (t_method)pdinfo_platform, + gensym("platform"), A_GIMME, 0); class_addmethod(pdinfo_class, (t_method)pdinfo_audio_samplerate, gensym("samplerate"), A_GIMME, 0); class_addmethod(pdinfo_class, (t_method)pdinfo_version, -- GitLab