aboutsummaryrefslogtreecommitdiff
path: root/desiredata/src/kernel.c
diff options
context:
space:
mode:
authorN.N. <matju@users.sourceforge.net>2009-05-14 00:47:19 +0000
committerN.N. <matju@users.sourceforge.net>2009-05-14 00:47:19 +0000
commitbe37b692d79f00d83948517e6994cc4210e138d9 (patch)
tree70e4884847c19b8d9e35a0e02d16655ba093cf8c /desiredata/src/kernel.c
parent890fffc2372a20a78051486e0f94ea8901b21508 (diff)
fix warnings due to new gcc thinking asprintf() might not return >=0...
svn path=/trunk/; revision=11330
Diffstat (limited to 'desiredata/src/kernel.c')
-rw-r--r--desiredata/src/kernel.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/desiredata/src/kernel.c b/desiredata/src/kernel.c
index 88a1b403..8a410853 100644
--- a/desiredata/src/kernel.c
+++ b/desiredata/src/kernel.c
@@ -35,6 +35,12 @@
#define a_gpointer a_w.w_gpointer
#define a_index a_w.w_index
+class Error {};
+class VeryUnlikelyError : Error {};
+
+#define asprintf(ARGS...) do {if ( asprintf(ARGS)<0) throw VeryUnlikelyError();} while(0)
+#define vasprintf(ARGS...) do {if (vasprintf(ARGS)<0) throw VeryUnlikelyError();} while(0)
+
using namespace std;
/* T.Grill - bit alignment for signal vectors (must be a multiple of 8!) */
@@ -2350,6 +2356,8 @@ void pd_init() {
#ifndef HAVE_ASPRINTF
#define HAVE_ASPRINTF
+#undef asprintf
+#undef vasprintf
int asprintf(char **str, const char *fmt, ...) throw () {
va_list ap;
int ret;