obj_print_statistics (stderr);
#endif
}
-
-/* The interface between the macro code and gas expression handling. */
-
-static size_t
-macro_expr (const char *emsg, size_t idx, sb *in, offsetT *val)
-{
- expressionS ex;
-
- sb_terminate (in);
-
- temp_ilp (in->ptr + idx);
- expression_and_evaluate (&ex);
- idx = input_line_pointer - in->ptr;
- restore_ilp ();
-
- if (ex.X_op != O_constant)
- as_bad ("%s", emsg);
-
- *val = ex.X_add_number;
-
- return idx;
-}
\f
/* Here to attempt 1 pass over each input file.
We scan argv[*] looking for filenames or exactly "" which is
#ifdef TC_I960
macro_strip_at = flag_mri;
#endif
- macro_init (flag_macro_alternate, flag_mri, macro_strip_at, macro_expr);
+ macro_init (flag_macro_alternate, flag_mri, macro_strip_at);
dwarf2_init ();
static int macro_strip_at;
-/* Function to use to parse an expression. */
-
-static size_t (*macro_expr) (const char *, size_t, sb *, offsetT *);
-
/* Number of macro expansions that have been done. */
static int macro_number;
/* Initialize macro processing. */
void
-macro_init (int alternate, int mri, int strip_at,
- size_t (*exp) (const char *, size_t, sb *, offsetT *))
+macro_init (int alternate, int mri, int strip_at)
{
macro_hash = htab_create_alloc (16, hash_string_tuple, eq_string_tuple,
macro_del_f, notes_calloc, NULL);
macro_alternate = alternate;
macro_mri = mri;
macro_strip_at = strip_at;
- macro_expr = exp;
}
void
}
else if (in->ptr[idx] == '%' && macro_alternate)
{
- offsetT val;
+ /* Turn the following expression into a string. */
+ expressionS ex;
char buf[64];
- /* Turns the next expression into a string. */
- /* xgettext: no-c-format */
- idx = (*macro_expr) (_("% operator needs absolute expression"),
- idx + 1,
- in,
- &val);
- sprintf (buf, "%" PRId64, (int64_t) val);
+ sb_terminate (in);
+
+ temp_ilp (in->ptr + idx + 1);
+ expression_and_evaluate (&ex);
+ idx = input_line_pointer - in->ptr;
+ restore_ilp ();
+
+ if (ex.X_op != O_constant)
+ as_bad (_("%% operator needs absolute expression"));
+
+ sprintf (buf, "%" PRId64, (int64_t) ex.X_add_number);
sb_add_string (out, buf);
}
else if (in->ptr[idx] == '"'
extern int buffer_and_nest (const char *, const char *, sb *,
size_t (*) (sb *));
-extern void macro_init (int, int, int,
- size_t (*) (const char *, size_t, sb *, offsetT *));
+extern void macro_init (int, int, int);
extern void macro_end (void);
extern void macro_set_alternate (int);
extern void macro_mri_mode (int);