aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flsupport.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2003-06-30 02:33:10 +0000
committerThomas Grill <xovo@users.sourceforge.net>2003-06-30 02:33:10 +0000
commit86bdc7d828f8df51a072da396217ce6c38b7034a (patch)
tree4c5bbfeadd75ba0821c54d02f6103e74811e7b3a /externals/grill/flext/source/flsupport.cpp
parentd5c52075e76d9eb3a373b6367f59d457ee9e7c71 (diff)
""
svn path=/trunk/; revision=739
Diffstat (limited to 'externals/grill/flext/source/flsupport.cpp')
-rw-r--r--externals/grill/flext/source/flsupport.cpp35
1 files changed, 35 insertions, 0 deletions
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 <stdio.h>
+#include <stdarg.h>
+
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
+}