diff lwasm/lwasm.c @ 351:4dba8c7e242c

conditional pseudo ops added
author lost@starbug
date Sat, 27 Mar 2010 23:37:30 -0600
parents 11a95c6414b4
children 60568b123281
line wrap: on
line diff
--- a/lwasm/lwasm.c	Sat Mar 27 22:59:15 2010 -0600
+++ b/lwasm/lwasm.c	Sat Mar 27 23:37:30 2010 -0600
@@ -88,6 +88,31 @@
 	va_end(args);
 }
 
+void lwasm_register_warning(asmstate_t *as, line_t *l, const char *msg, ...)
+{
+	lwasm_error_t *e;
+	va_list args;
+	char errbuff[1024];
+	int r;
+	
+	if (!l)
+		return;
+
+	va_start(args, msg);
+	
+	e = lw_alloc(sizeof(lwasm_error_t));
+	
+	e -> next = l -> err;
+	l -> err = e;
+	
+	as -> errorcount++;
+	
+	r = vsnprintf(errbuff, 1024, msg, args);
+	e -> mess = lw_strdup(errbuff);
+	
+	va_end(args);
+}
+
 int lwasm_next_context(asmstate_t *as)
 {
 	int r;