comparison main.c @ 18:c08a947d8f30

deal with macro parameters
author David A. Holland
date Mon, 20 Dec 2010 01:51:47 -0500
parents 76da41da923f
children 76c114899f63
comparison
equal deleted inserted replaced
17:76da41da923f 18:c08a947d8f30
131 131
132 num = array_num(&commandline_macros); 132 num = array_num(&commandline_macros);
133 for (i=0; i<num; i++) { 133 for (i=0; i<num; i++) {
134 cm = array_get(&commandline_macros, i); 134 cm = array_get(&commandline_macros, i);
135 if (cm->expansion != NULL) { 135 if (cm->expansion != NULL) {
136 macro_define(&cm->where, cm->macro, 136 macro_define_plain(&cm->where, cm->macro,
137 &cm->where2, cm->expansion); 137 &cm->where2, cm->expansion);
138 } else { 138 } else {
139 macro_undef(cm->macro); 139 macro_undef(cm->macro);
140 } 140 }
141 free(cm); 141 free(cm);
142 } 142 }
148 apply_builtin_macro(unsigned num, const char *name, const char *val) 148 apply_builtin_macro(unsigned num, const char *name, const char *val)
149 { 149 {
150 struct place p; 150 struct place p;
151 151
152 place_setbuiltin(&p, num); 152 place_setbuiltin(&p, num);
153 macro_define(&p, name, &p, val); 153 macro_define_plain(&p, name, &p, val);
154 } 154 }
155 155
156 static 156 static
157 void 157 void
158 apply_builtin_macros(void) 158 apply_builtin_macros(void)