commit a5600f2bcf64b1f4c7d49e2e5bcac26e90a8a9ab
parent 2ee5e1aa28992bf2a135bc59af74e65124342488
Author: Kris Maglione <jg@suckless.org>
Date: Sun, 1 Jul 2007 07:51:34 -0400
Don't build ruby or task thread stubs by default.
Diffstat:
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/config.mk b/config.mk
@@ -2,7 +2,8 @@
COMPONENTS = \
libixp \
- libixp_pthread \
+ libixp_pthread
+IGNORE = \
libixp_task \
libixp_rubythread
diff --git a/include/ixp.h b/include/ixp.h
@@ -3,6 +3,7 @@
* See LICENSE file for license details.
*/
+#include <stdarg.h>
#include <sys/types.h>
#undef uchar
@@ -395,6 +396,7 @@ struct IxpThread {
};
extern IxpThread *ixp_thread;
+extern int (*ixp_vsnprint)(char*, int, char*, va_list);
/* thread_*.c */
int ixp_taskinit(void);
diff --git a/libixp/error.c b/libixp/error.c
@@ -4,6 +4,8 @@
#include <string.h>
#include "ixp_local.h"
+int (*ixp_vsnprint)(char*, int, char*, va_list);
+
/* Approach to errno handling taken from Plan 9 Port. */
enum {
EPLAN9 = 0x19283745,
@@ -42,7 +44,10 @@ werrstr(char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
- vsnprintf(tmp, sizeof(tmp), fmt, ap);
+ if(ixp_vsnprint)
+ ixp_vsnprint(tmp, sizeof(tmp), fmt, ap);
+ else
+ vsnprintf(tmp, sizeof(tmp), fmt, ap);
va_end(ap);
strncpy(thread->errbuf(), tmp, IXP_ERRMAX);
errno = EPLAN9;