From 86bdc7d828f8df51a072da396217ce6c38b7034a Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Mon, 30 Jun 2003 02:33:10 +0000 Subject: "" svn path=/trunk/; revision=739 --- externals/grill/flext/source/flsupport.cpp | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'externals/grill/flext/source/flsupport.cpp') diff --git a/externals/grill/flext/source/flsupport.cpp b/externals/grill/flext/source/flsupport.cpp index ac501f78..9e6a2491 100644 --- a/externals/grill/flext/source/flsupport.cpp +++ b/externals/grill/flext/source/flsupport.cpp @@ -14,6 +14,9 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include "flext.h" +#include +#include + const t_symbol *flext::sym_float = NULL; const t_symbol *flext::sym_symbol = NULL; const t_symbol *flext::sym_bang = NULL; @@ -171,3 +174,35 @@ int flext::Int2Bits(unsigned long n) return b; } +void flext::post(const char *fmt, ...) +{ +#ifdef FLEXT_THREADS + static ThrMutex mutex; + mutex.Lock(); +#endif + va_list ap; + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + putc('\n', stderr); +#ifdef FLEXT_THREADS + mutex.Unlock(); +#endif +} + +void flext::error(const char *fmt,...) +{ +#ifdef FLEXT_THREADS + static ThrMutex mutex; + mutex.Lock(); +#endif + va_list ap; + va_start(ap, fmt); + fprintf(stderr, "error: "); + vfprintf(stderr, fmt, ap); + va_end(ap); + putc('\n', stderr); +#ifdef FLEXT_THREADS + mutex.Unlock(); +#endif +} -- cgit v1.2.1