~bkerensa/ubuntu/raring/yasm/fix-for-1064341

« back to all changes in this revision

Viewing changes to modules/preprocs/nasm/nasm-preproc.c

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hocevar
  • Date: 2009-07-14 08:23:59 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090714082359-10x8mjty41gzkshs
Tags: 0.8.0-1
* New upstream release (Closes: #531047).
* Removed all tasm patches, they’ve been merged upstream.
* debian/control: set debhelper dependency to 5.0 and policy to 3.8.2.
* debian/control: mention TASM in the long description.
* debian/compat: set debhelper level to 5.
* debian/links: link tasm to ytasm and tasm.1.gz to ytasm.1.gz.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 * POSSIBILITY OF SUCH DAMAGE.
26
26
 */
27
27
#include <util.h>
28
 
/*@unused@*/ RCSID("$Id: nasm-preproc.c 2008 2007-11-03 04:37:44Z peter $");
 
28
/*@unused@*/ RCSID("$Id: nasm-preproc.c 2185 2009-03-24 06:33:32Z peter $");
29
29
 
30
30
#include <libyasm.h>
31
31
 
47
47
static yasm_linemap *cur_lm;
48
48
static yasm_errwarns *cur_errwarns;
49
49
int tasm_compatible_mode = 0;
 
50
int tasm_locals;
 
51
const char *tasm_segment;
 
52
 
 
53
#include "nasm-version.c"
50
54
 
51
55
typedef struct preproc_dep {
52
56
    STAILQ_ENTRY(preproc_dep) link;
156
160
    preproc_nasm->lineinc = 0;
157
161
    nasmpp.reset(f, in_filename, 2, nasm_efunc, nasm_evaluate, &nil_list);
158
162
 
 
163
    pp_extra_stdmac(nasm_version_mac);
 
164
 
159
165
    return (yasm_preproc *)preproc_nasm;
160
166
}
161
167
 
189
195
 
190
196
    line = nasmpp.getline();
191
197
    if (!line)
 
198
    {
 
199
        nasmpp.cleanup(1);
192
200
        return NULL;    /* EOF */
 
201
    }
193
202
 
194
203
    linnum = preproc_nasm->prior_linnum += preproc_nasm->lineinc;
195
204
    altline = nasm_src_get(&linnum, &preproc_nasm->file_name);
290
299
    yasm_xfree(mnv);
291
300
}
292
301
 
 
302
static void
 
303
nasm_preproc_add_standard(yasm_preproc *preproc, const char **macros)
 
304
{
 
305
    pp_extra_stdmac(macros);
 
306
}
 
307
 
293
308
/* Define preproc structure -- see preproc.h for details */
294
309
yasm_preproc_module yasm_nasm_LTX_preproc = {
295
310
    "Real NASM Preprocessor",
301
316
    nasm_preproc_add_include_file,
302
317
    nasm_preproc_predefine_macro,
303
318
    nasm_preproc_undefine_macro,
304
 
    nasm_preproc_define_builtin
 
319
    nasm_preproc_define_builtin,
 
320
    nasm_preproc_add_standard
 
321
};
 
322
 
 
323
static yasm_preproc *
 
324
tasm_preproc_create(const char *in_filename, yasm_symtab *symtab,
 
325
                    yasm_linemap *lm, yasm_errwarns *errwarns)
 
326
{
 
327
    tasm_compatible_mode = 1;
 
328
    return nasm_preproc_create(in_filename, symtab, lm, errwarns);
 
329
}
 
330
 
 
331
yasm_preproc_module yasm_tasm_LTX_preproc = {
 
332
    "Real TASM Preprocessor",
 
333
    "tasm",
 
334
    tasm_preproc_create,
 
335
    nasm_preproc_destroy,
 
336
    nasm_preproc_get_line,
 
337
    nasm_preproc_get_included_file,
 
338
    nasm_preproc_add_include_file,
 
339
    nasm_preproc_predefine_macro,
 
340
    nasm_preproc_undefine_macro,
 
341
    nasm_preproc_define_builtin,
 
342
    nasm_preproc_add_standard
305
343
};