From 68c78791ee4d8040d1bb82dd0f5a60f9a02703ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 9 Feb 2011 17:07:09 +0000 Subject: protect against missing g_canvas.h svn path=/trunk/externals/iemlib/; revision=14887 --- iemlib2/src/parentdollarzero.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'iemlib2/src') diff --git a/iemlib2/src/parentdollarzero.c b/iemlib2/src/parentdollarzero.c index 85b79e9..3f209b1 100644 --- a/iemlib2/src/parentdollarzero.c +++ b/iemlib2/src/parentdollarzero.c @@ -5,7 +5,9 @@ iemlib2 written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 #include "m_pd.h" -#include "g_canvas.h" +#ifdef HAVE_G_CANVAS_H +# include "g_canvas.h" +#endif #include "iemlib.h" @@ -30,6 +32,7 @@ static void parentdollarzero_bang(t_parentdollarzero *x) static void *parentdollarzero_new(void) { t_parentdollarzero *x = (t_parentdollarzero *)pd_new(parentdollarzero_class); +#ifdef HAVE_G_CANVAS_H t_glist *glist = (t_glist *)canvas_getcurrent(); t_canvas *this_canvas = glist_getcanvas(glist); @@ -38,6 +41,10 @@ static void *parentdollarzero_new(void) if(x->x_is_there_a_parent) x->s_parent_unique = canvas_realizedollar((t_canvas *)this_canvas->gl_owner, gensym("$0")); else +#else + x->x_is_there_a_parent=0; + error("[parentdollarzero]: compiled without g_canvas.h - cannot work properly!"); +#endif x->s_parent_unique = gensym(""); outlet_new(&x->x_obj, &s_symbol); return (x); -- cgit v1.2.1