Add a test for this.
+2003-03-31 Ian Lance Taylor <ian@airs.com>
+
+ * rcparse.y: Replace uses of 'optstringrc' with 'optresid'.
+ (optresid): Handle a resource id that can be a string or a number.
+ * resrc.c (define_control): Replace 'text' parameter with 'iid' a
+ struct res_id.
+ (define_icon_control): Pass a struct res_id to define_control.
+ * windres.h (define_control): Change prototype.
+
2003-03-24 Elias Athanasopoulos <elathan@phys.uoa.gr>
* objcopy (OPTION_FORMATS_INFO): Define.
libbfd.h.
* Makefile.in: Regenerate.
-2003-03-22 Danny Smith <dannysmith@users.sourceforge,net>
+2003-03-22 Danny Smith <dannysmith@users.sourceforge.net>
* dlltool.c (gen_def_file): Put demangled name comments on
own line preceding export name.
%{ /* rcparse.y -- parser for Windows rc files
- Copyright 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of GNU Binutils.
%type <vervar> vertrans
%type <res_info> suboptions memflags_move_discard memflags_move
%type <memflags> memflag
-%type <id> id resref
+%type <id> id optresidc resref
%type <il> exstyle parennumber
%type <il> numexpr posnumexpr cnumexpr optcnumexpr cposnumexpr
%type <is> acc_options acc_option menuitem_flags menuitem_flag
-%type <s> optstringc file_name resname
+%type <s> file_name resname
%type <i> sizednumexpr sizedposnumexpr
%left '|'
{
$$ = $3;
}
- | CONTROL optstringc numexpr cnumexpr control_styleexpr cnumexpr
+ | CONTROL optresidc numexpr cnumexpr control_styleexpr cnumexpr
cnumexpr cnumexpr cnumexpr optcnumexpr opt_control_data
{
$$ = define_control ($2, $3, $6, $7, $8, $9, $4, style, $10);
$$->data = $11;
}
}
- | CONTROL optstringc numexpr cnumexpr control_styleexpr cnumexpr
+ | CONTROL optresidc numexpr cnumexpr control_styleexpr cnumexpr
cnumexpr cnumexpr cnumexpr cnumexpr cnumexpr opt_control_data
{
$$ = define_control ($2, $3, $6, $7, $8, $9, $4, style, $10);
$$->help = $11;
$$->data = $12;
}
- | CONTROL optstringc numexpr ',' QUOTEDSTRING control_styleexpr
+ | CONTROL optresidc numexpr ',' QUOTEDSTRING control_styleexpr
cnumexpr cnumexpr cnumexpr cnumexpr optcnumexpr opt_control_data
{
$$ = define_control ($2, $3, $7, $8, $9, $10, 0, style, $11);
$$->class.named = 1;
unicode_from_ascii (&$$->class.u.n.length, &$$->class.u.n.name, $5);
}
- | CONTROL optstringc numexpr ',' QUOTEDSTRING control_styleexpr
+ | CONTROL optresidc numexpr ',' QUOTEDSTRING control_styleexpr
cnumexpr cnumexpr cnumexpr cnumexpr cnumexpr cnumexpr opt_control_data
{
$$ = define_control ($2, $3, $7, $8, $9, $10, 0, style, $11);
{
$$ = $3;
}
- | USERBUTTON QUOTEDSTRING ',' numexpr ',' numexpr ',' numexpr ','
+ | USERBUTTON resref numexpr ',' numexpr ',' numexpr ','
numexpr ',' numexpr ','
{ style = WS_CHILD | WS_VISIBLE; }
styleexpr optcnumexpr
{
- $$ = define_control ($2, $4, $6, $8, $10, $12, CTL_BUTTON,
- style, $16);
+ $$ = define_control ($2, $3, $5, $7, $9, $11, CTL_BUTTON,
+ style, $15);
}
;
style. CLASS is the class of the control. */
control_params:
- optstringc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
+ optresidc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
opt_control_data
{
$$ = define_control ($1, $2, $3, $4, $5, $6, class,
$$->data = $7;
}
}
- | optstringc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
+ | optresidc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
control_params_styleexpr optcnumexpr opt_control_data
{
$$ = define_control ($1, $2, $3, $4, $5, $6, class, style, $8);
$$->data = $9;
}
}
- | optstringc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
+ | optresidc numexpr cnumexpr cnumexpr cnumexpr cnumexpr
control_params_styleexpr cnumexpr cnumexpr opt_control_data
{
$$ = define_control ($1, $2, $3, $4, $5, $6, class, style, $8);
}
;
-optstringc:
+optresidc:
/* empty */
{
- $$ = NULL;
+ res_string_to_id (&$$, "");
+ }
+ | posnumexpr ','
+ {
+ $$.named = 0;
+ $$.u.id = $1;
}
| QUOTEDSTRING
{
- $$ = $1;
+ res_string_to_id (&$$, $1);
}
| QUOTEDSTRING ','
{
- $$ = $1;
+ res_string_to_id (&$$, $1);
}
;
/* resrc.c -- read and write Windows rc files.
- Copyright 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of GNU Binutils.
merely allocates and fills in a structure. */
struct dialog_control *
-define_control (text, id, x, y, width, height, class, style, exstyle)
- const char *text;
+define_control (iid, id, x, y, width, height, class, style, exstyle)
+ struct res_id iid;
unsigned long id;
unsigned long x;
unsigned long y;
n->height = height;
n->class.named = 0;
n->class.u.id = class;
- if (text == NULL)
- text = "";
- res_string_to_id (&n->text, text);
+ n->text = iid;
n->data = NULL;
n->help = 0;
struct dialog_ex *ex;
{
struct dialog_control *n;
+ struct res_id tid;
+
if (style == 0)
style = SS_ICON | WS_CHILD | WS_VISIBLE;
- n = define_control (0, id, x, y, 0, 0, CTL_STATIC, style, exstyle);
+ res_string_to_id (&tid, "");
+ n = define_control (tid, id, x, y, 0, 0, CTL_STATIC, style, exstyle);
n->text = iid;
if (help && !ex)
rcparse_warning (_("help ID requires DIALOGEX"));
+2003-03-31 Nick Clifton <nickc@redhat.com>
+
+ * binutils-all/windres/dialogid.rc: New test source file.
+ * binutils-all/windres/dialogid.rsd: New test expected results.
+
2002-11-07 Casper S. Hornstrup <chorns@users.sourceforge.net>
* binutils-all/dlltool.exp: New file for testing dlltool.
--- /dev/null
+// Test created based on bug report submitted to binutils mailing list
+// See: http://sources.redhat.com/ml/binutils/2003-03/msg00312.html
+
+101 DIALOGEX 0, 0, 200, 200
+
+BEGIN
+CONTROL 108, -1, "Static", 77, 11, 11, 83, 162
+CONTROL "stringid", 102, "Static", 0x5000120e, 5, 5, 10, 10
+END
--- /dev/null
+ 0000 00000000 20000000 ffff0000 ffff0000 .... ...........
+ 0010 00000000 00000000 00000000 00000000 ................
+ 0020 86000000 20000000 ffff0500 ffff6500 .... .........e.
+ 0030 00000000 30100904 00000000 00000000 ....0...........
+ 0040 0100ffff 00000000 00000000 00008880 ................
+ 0050 02000000 0000c800 c8000000 00000000 ................
+ 0060 00000000 00000000 4d000050 0b000b00 ........M..P....
+ 0070 5300a200 ffff0000 53007400 61007400 S.......S.t.a.t.
+ 0080 69006300 0000ffff 6c000000 00000000 i.c.....l.......
+ 0090 00000000 0e120050 05000500 0a000a00 .......P........
+ 00a0 66000000 53007400 61007400 69006300 f...S.t.a.t.i.c.
+ 00b0 00007300 74007200 69006e00 67006900 ..s.t.r.i.n.g.i.
+ 00c0 64000000 00000000 d.......
/* windres.h -- header file for windres program.
- Copyright 1997, 1998, 2000, 2002 Free Software Foundation, Inc.
+ Copyright 1997, 1998, 2000, 2002, 2003 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
This file is part of GNU Binutils.
extern FILE *yyin;
extern char *rc_filename;
extern int rc_lineno;
+
extern int yyparse PARAMS ((void));
extern int yylex PARAMS ((void));
extern void yyerror PARAMS ((const char *));
extern void define_dialog
PARAMS ((struct res_id, const struct res_res_info *, const struct dialog *));
extern struct dialog_control *define_control
- PARAMS ((const char *, unsigned long, unsigned long, unsigned long,
+ PARAMS ((struct res_id, unsigned long, unsigned long, unsigned long,
unsigned long, unsigned long, unsigned long, unsigned long,
unsigned long));
extern struct dialog_control *define_icon_control
PARAMS ((struct res_id, const struct res_res_info *, struct rcdata_item *));
extern struct rcdata_item *define_rcdata_string
PARAMS ((const char *, unsigned long));
-extern struct rcdata_item *define_rcdata_number PARAMS ((unsigned long, int));
+extern struct rcdata_item *define_rcdata_number
+ PARAMS ((unsigned long, int));
extern void define_stringtable
PARAMS ((const struct res_res_info *, unsigned long, const char *));
extern void define_user_data