forked from Imagelibrary/binutils-gdb
[PATCH] fix windmc typedef bug
While a typedef can be specified in message files for the messages following with the `MessageIdTypedef` directive, only the last typedef was honored by windmc. This corrects this behavior, matching mc.exe functionality. * windmc.h (struct mc_node): Add id_typecast field. * mcparse.y (message): Initialise the id_typecast field. * windmc.c (write_dbg): Use the id_typecast field as a parameter when calling write_dbg_define. (write_header): Likewise.
This commit is contained in:
committed by
Nick Clifton
parent
5144dfba28
commit
913e0fd473
@@ -1,3 +1,11 @@
|
|||||||
|
2020-06-03 Joel Anderson <joelanderson333@gmail.com>
|
||||||
|
|
||||||
|
* windmc.h (struct mc_node): Add id_typecast field.
|
||||||
|
* mcparse.y (message): Initialise the id_typecast field.
|
||||||
|
* windmc.c (write_dbg): Use the id_typecast field as a parameter
|
||||||
|
when calling write_dbg_define.
|
||||||
|
(write_header): Likewise.
|
||||||
|
|
||||||
2020-06-03 Alan Modra <amodra@gmail.com>
|
2020-06-03 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
PR 26069
|
PR 26069
|
||||||
|
|||||||
@@ -181,6 +181,7 @@ message:
|
|||||||
cur_node->severity = mc_cur_severity;
|
cur_node->severity = mc_cur_severity;
|
||||||
cur_node->id = ($1 & 0xffffUL);
|
cur_node->id = ($1 & 0xffffUL);
|
||||||
cur_node->vid = ($1 & 0xffffUL) | mc_sefa_val;
|
cur_node->vid = ($1 & 0xffffUL) | mc_sefa_val;
|
||||||
|
cur_node->id_typecast = mcset_msg_id_typedef;
|
||||||
mc_last_id = $1;
|
mc_last_id = $1;
|
||||||
}
|
}
|
||||||
lang_entities
|
lang_entities
|
||||||
|
|||||||
@@ -821,7 +821,7 @@ write_dbg (FILE *fp)
|
|||||||
while (h != NULL)
|
while (h != NULL)
|
||||||
{
|
{
|
||||||
if (h->symbol)
|
if (h->symbol)
|
||||||
write_dbg_define (fp, h->symbol, mcset_msg_id_typedef);
|
write_dbg_define (fp, h->symbol, h->id_typecast);
|
||||||
h = h->next;
|
h = h->next;
|
||||||
}
|
}
|
||||||
fprintf (fp, " { (");
|
fprintf (fp, " { (");
|
||||||
@@ -908,7 +908,7 @@ write_header (FILE *fp)
|
|||||||
fprintf (fp, "%s", s);
|
fprintf (fp, "%s", s);
|
||||||
}
|
}
|
||||||
if (h->symbol)
|
if (h->symbol)
|
||||||
write_header_define (fp, h->symbol, h->vid, mcset_msg_id_typedef, h->sub);
|
write_header_define (fp, h->symbol, h->vid, h->id_typecast, h->sub);
|
||||||
h = h->next;
|
h = h->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ typedef struct mc_node
|
|||||||
unichar *symbol;
|
unichar *symbol;
|
||||||
rc_uint_type id;
|
rc_uint_type id;
|
||||||
rc_uint_type vid;
|
rc_uint_type vid;
|
||||||
|
unichar *id_typecast;
|
||||||
mc_node_lang *sub;
|
mc_node_lang *sub;
|
||||||
} mc_node;
|
} mc_node;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user