[GEM-cvs] Gem/src/Base CPPExtern.cpp, 1.4, 1.5 CPPExtern.h, 1.15, 1.16
Brought to you by:
zmoelnig
From: IOhannes m z. <zmo...@us...> - 2006-09-21 14:32:28
|
Update of /cvsroot/pd-gem/Gem/src/Base In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31465/Base Modified Files: CPPExtern.cpp CPPExtern.h Log Message: added PDerror() which calls pd_error() without having to worry about the object ("ourselves") Index: CPPExtern.cpp =================================================================== RCS file: /cvsroot/pd-gem/Gem/src/Base/CPPExtern.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CPPExtern.cpp 16 Aug 2006 10:03:56 -0000 1.4 --- CPPExtern.cpp 21 Sep 2006 14:31:52 -0000 1.5 *************** *** 15,18 **** --- 15,23 ---- #include "CPPExtern.h" + + #include <stdio.h> + #include <stdarg.h> + + GEM_EXTERN void *operator new(size_t, void *location, void *) {return(location);} *************** *** 62,63 **** --- 67,83 ---- { } + + void CPPExtern :: PDerror(const char*fmt,...) + { + char buf[MAXPDSTRING]; + va_list ap; + va_start(ap, fmt); + vsnprintf(buf, MAXPDSTRING-1, fmt, ap); + va_end(ap); + if(x_obj) + pd_error(x_obj, "%s", buf); + else if (m_holder) + pd_error(m_holder, "%s", buf); + else + error("%s", buf); + } Index: CPPExtern.h =================================================================== RCS file: /cvsroot/pd-gem/Gem/src/Base/CPPExtern.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** CPPExtern.h 3 Sep 2006 16:50:51 -0000 1.15 --- CPPExtern.h 21 Sep 2006 14:31:52 -0000 1.16 *************** *** 149,152 **** --- 149,155 ---- t_canvas *m_canvas; + public: + // an error message attached to this object + void PDerror(const char*format, ...); }; |