Index: src/binutils/windres.c =================================================================== --- src.orig/binutils/windres.c 2011-04-09 18:01:32.861135500 +0200 +++ src/binutils/windres.c 2011-04-11 13:38:57.699191700 +0200 @@ -665,6 +665,7 @@ usage (FILE *stream, int status) -O --output-format= Specify output format\n\ -F --target= Specify COFF target\n\ --preprocessor= Program to use to preprocess rc file\n\ + --preprocessor-arg= Additional preprocessor argument\n\ -I --include-dir= Include directory when preprocessing rc file\n\ -D --define [=] Define SYM when preprocessing rc file\n\ -U --undefine Undefine SYM when preprocessing rc file\n\ @@ -734,7 +735,8 @@ enum option_values OPTION_USE_TEMP_FILE, OPTION_NO_USE_TEMP_FILE, OPTION_YYDEBUG, - OPTION_INCLUDE_DIR + OPTION_INCLUDE_DIR, + OPTION_PREPROCESSOR_ARG }; static const struct option long_options[] = @@ -745,6 +747,7 @@ static const struct option long_options[ {"output-format", required_argument, 0, 'O'}, {"target", required_argument, 0, 'F'}, {"preprocessor", required_argument, 0, OPTION_PREPROCESSOR}, + {"preprocessor-arg", required_argument, 0, OPTION_PREPROCESSOR_ARG}, {"include-dir", required_argument, 0, OPTION_INCLUDE_DIR}, {"define", required_argument, 0, 'D'}, {"undefine", required_argument, 0, 'U'}, @@ -888,6 +891,23 @@ main (int argc, char **argv) case OPTION_PREPROCESSOR: preprocessor = optarg; break; + case OPTION_PREPROCESSOR_ARG: + if (preprocargs == NULL) + { + quotedarg = quot (optarg); + preprocargs = xstrdup (quotedarg); + } + else + { + char *n; + + quotedarg = quot (optarg); + n = xmalloc (strlen (preprocargs) + strlen (quotedarg) + 2); + sprintf (n, "%s %s", preprocargs, quotedarg); + free (preprocargs); + preprocargs = n; + } + break; case 'D': case 'U': Index: src/binutils/NEWS =================================================================== --- src.orig/binutils/NEWS 2010-11-11 18:04:30.000000000 +0100 +++ src/binutils/NEWS 2011-04-11 13:47:24.878595300 +0200 @@ -1,5 +1,8 @@ -*- text -*- +* Add --preprocessor-arg option to windres to specify additional options + passed to preprocessor. + Changes in 2.21: Index: src/binutils/doc/binutils.texi =================================================================== --- src.orig/binutils/doc/binutils.texi 2010-12-18 12:26:24.000000000 +0100 +++ src/binutils/doc/binutils.texi 2011-04-11 13:44:43.793640100 +0200 @@ -3450,6 +3450,11 @@ preprocessor first. This option may be to use, including any leading arguments. The default preprocessor argument is @code{gcc -E -xc-header -DRC_INVOKED}. +@item --preprocessor-arg @var{option} +When @command{windres} reads an @code{rc} file, it runs it through the C +preprocessor first. This option may be used to specify additional +option to be passed to preprocessor. + @item -I @var{directory} @itemx --include-dir @var{directory} Specify an include directory to use when reading an @code{rc} file.