comparison lwasm/symbol.c @ 206:080bb67d84f2

Add export pragma Added a pragma "export" which causes all exportable symbols to be exported automatically.
author William Astle <lost@l-w.ca>
date Thu, 24 May 2012 17:28:15 -0600
parents 17bd59f045af
children 07e1fac76321
comparison
equal deleted inserted replaced
205:806e5fc6dd93 206:080bb67d84f2
203 if (cdir < 0) 203 if (cdir < 0)
204 sprev -> left = nse; 204 sprev -> left = nse;
205 else 205 else
206 sprev -> right = nse; 206 sprev -> right = nse;
207 } 207 }
208 if (CURPRAGMA(cl, PRAGMA_EXPORT) && cl -> csect && !islocal)
209 {
210 exportlist_t *e;
211
212 /* export symbol if not already exported */
213 e = lw_alloc(sizeof(exportlist_t));
214 e -> next = as -> exportlist;
215 e -> symbol = lw_strdup(sym);
216 e -> line = cl;
217 e -> se = nse;
218 as -> exportlist = e;
219 }
208 return nse; 220 return nse;
209 } 221 }
210 222
211 // for "SET" symbols, always returns the LAST definition of the 223 // for "SET" symbols, always returns the LAST definition of the
212 // symbol. This works because the lwasm_reduce_expr() call in 224 // symbol. This works because the lwasm_reduce_expr() call in