diff src/pragma.c @ 73:4b37f17624a7

Added pragma directives
author lost
date Thu, 08 Jan 2009 01:18:09 +0000
parents 34568fab6058
children 0ee5f65bccf9
line wrap: on
line diff
--- a/src/pragma.c	Tue Jan 06 06:20:31 2009 +0000
+++ b/src/pragma.c	Thu Jan 08 01:18:09 2009 +0000
@@ -25,6 +25,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include "lwasm.h"
+#include "instab.h"
 
 /*
 A pragma is a means of controlling code generation.
@@ -55,7 +56,7 @@
 which may be very useful.
 */
 
-void pseudo_pragma_real(asmstate_t *as, sourceline_t *cl, char **optr, int error)
+void pseudo_pragma_real(asmstate_t *as, lwasm_line_t *cl, char **optr, int error)
 {
 	char pragma[128];
 	int c = 0;
@@ -72,7 +73,9 @@
 	if (c == 0 || (**optr && !isspace(**optr)))
 	{
 		if (error)
-			errorp1(ERR_PRAGMA);
+		{
+			register_error(as, cl, 1, "Unrecognized pragma");
+		}
 		return;
 	}
 	pragma[c] = 0;
@@ -87,16 +90,18 @@
 	else
 	{
 		if (error)
-			errorp1(ERR_PRAGMA);
+		{
+			register_error(as, cl, 1, "Unrecognized pragma");
+		}
 	}
 }
 
-void pseudo_pragma(asmstate_t *as, sourceline_t *cl, char **optr)
+OPFUNC(pseudo_pragma)
 {
-	pseudo_pragma_real(as, cl, optr, 1);
+	pseudo_pragma_real(as, l, p, 1);
 }
 
-void pseudo_starpragma(asmstate_t *as, sourceline_t *cl, char **optr)
+OPFUNC(pseudo_starpragma)
 {
-	pseudo_pragma_real(as, cl, optr, 0);
+	pseudo_pragma_real(as, l, p, 0);
 }