This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
windres: -U
- From: "Dimitrie O. Paun" <dimi at intelliware dot ca>
- To: Christopher Faylor <cgf at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 1 Apr 2003 17:24:43 -0500 (EST)
- Subject: windres: -U
On Tue, 1 Apr 2003, Christopher Faylor wrote:
> Applied.
Thanks!
Another small one that can probably just go through. Motivation
for having a -U option was provided in a message I've sent to
the list a few days ago.
2003-04-01 Dimitrie O. Paun <dpaun at rogers dot com>
* windres.c: Add -U for compatibility with wrc, rc, and cpp.
(main): Just pass the -U option down to the preprocessor.
* doc/binutils.texi: Added -U to the list of options.
Index: doc/binutils.texi
===================================================================
RCS file: /cvs/src/src/binutils/doc/binutils.texi,v
retrieving revision 1.33
diff -u -r1.33 binutils.texi
--- doc/binutils.texi 1 Apr 2003 23:09:29 -0000 1.33
+++ doc/binutils.texi 1 Apr 2003 23:35:44 -0000
@@ -2614,6 +2614,11 @@
Specify a @option{-D} option to pass to the preprocessor when reading an
@code{rc} file.
+ at item -U @var{target}
+ at itemx --undefine @var{sym}
+Specify a @option{-U} option to pass to the preprocessor when reading an
+ at code{rc} file.
+
@item -r
Ignored for compatibility with rc.
Index: windres.c
===================================================================
RCS file: /cvs/src/src/binutils/windres.c,v
retrieving revision 1.14
diff -u -r1.14 windres.c
--- windres.c 1 Apr 2003 23:09:29 -0000 1.14
+++ windres.c 1 Apr 2003 23:35:45 -0000
@@ -108,8 +108,7 @@
/* 150 isn't special; it's just an arbitrary non-ASCII char value. */
-#define OPTION_DEFINE 150
-#define OPTION_HELP (OPTION_DEFINE + 1)
+#define OPTION_HELP 150
#define OPTION_INCLUDE_DIR (OPTION_HELP + 1)
#define OPTION_LANGUAGE (OPTION_INCLUDE_DIR + 1)
#define OPTION_PREPROCESSOR (OPTION_LANGUAGE + 1)
@@ -120,7 +119,7 @@
static const struct option long_options[] =
{
- {"define", required_argument, 0, OPTION_DEFINE},
+ {"define", required_argument, 0, 'D'},
{"help", no_argument, 0, OPTION_HELP},
{"include-dir", required_argument, 0, OPTION_INCLUDE_DIR},
{"input-format", required_argument, 0, 'I'},
@@ -128,6 +127,7 @@
{"output-format", required_argument, 0, 'O'},
{"preprocessor", required_argument, 0, OPTION_PREPROCESSOR},
{"target", required_argument, 0, 'F'},
+ {"undefine", required_argument, 0, 'U'},
{"use-temp-file", no_argument, 0, OPTION_USE_TEMP_FILE},
{"no-use-temp-file", no_argument, 0, OPTION_NO_USE_TEMP_FILE},
{"verbose", no_argument, 0, 'v'},
@@ -710,6 +710,7 @@
--preprocessor=<program> Program to use to preprocess rc file\n\
--include-dir=<dir> Include directory when preprocessing rc file\n\
-D --define <sym>[=<val>] Define SYM when preprocessing rc file\n\
+ -U --undefine <sym> Undefine SYM when preprocessing rc file\n\
-v --verbose Verbose - tells you what it's doing\n\
--language=<val> Set language when reading rc file\n\
--use-temp-file Use a temporary file instead of popen to read\n\
@@ -846,12 +847,12 @@
break;
case 'D':
- case OPTION_DEFINE:
+ case 'U':
if (preprocargs == NULL)
{
quotedarg = quot (optarg);
preprocargs = xmalloc (strlen (quotedarg) + 3);
- sprintf (preprocargs, "-D%s", quotedarg);
+ sprintf (preprocargs, "-%c%s", c, quotedarg);
}
else
{
@@ -859,7 +860,7 @@
quotedarg = quot (optarg);
n = xmalloc (strlen (preprocargs) + strlen (quotedarg) + 4);
- sprintf (n, "%s -D%s", preprocargs, quotedarg);
+ sprintf (n, "%s -%c%s", preprocargs, c, quotedarg);
free (preprocargs);
preprocargs = n;
}
--
Dimi.