From 117021570515fa985670f78d27376d636ed5490f Mon Sep 17 00:00:00 2001 From: Ulrich Mueller Date: Wed, 5 Jan 2011 13:31:36 -0800 Subject: Call C preprocessor with -P option due to changed behaviour in GCC 4.5 http://bugs.freedesktop.org/show_bug.cgi?id=32701 http://bugs.gentoo.org/show_bug.cgi?id=347758 Signed-off-by: Ulrich Mueller Signed-off-by: Alan Coopersmith --- xrdb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xrdb.c b/xrdb.c index ffd6f1d..2e5882a 100644 --- a/xrdb.c +++ b/xrdb.c @@ -1179,7 +1179,7 @@ Process(int scrno, Bool doScreen, Bool execute) fprintf(input, "\n#include \"%s\"\n", filename); fclose(input); (void) mktemp(tmpname3); - if (asprintf(&cmd, "%s%s %s > %s", cpp_program, includes.val, + if (asprintf(&cmd, "%s -P%s %s > %s", cpp_program, includes.val, tmpname2, tmpname3) == -1) fatal("%s: Out of memory\n", ProgramName); if (system(cmd) < 0) @@ -1194,7 +1194,7 @@ Process(int scrno, Bool doScreen, Bool execute) fprintf(stdin, "\n#include \"%s\"\n", filename); fflush(stdin); fseek(stdin, 0, 0); - if (asprintf(&cmd, "%s%s", cpp_program, includes.val) == -1) + if (asprintf(&cmd, "%s -P%s", cpp_program, includes.val) == -1) fatal("%s: Out of memory\n", ProgramName); if (!(input = popen(cmd, "r"))) fatal("%s: cannot run '%s'\n", ProgramName, cmd); @@ -1209,7 +1209,7 @@ Process(int scrno, Bool doScreen, Bool execute) if (cpp_program) { #ifdef WIN32 (void) mktemp(tmpname3); - if (asprintf(&cmd, "%s%s %s %s > %s", cpp_program, + if (asprintf(&cmd, "%s -P%s %s %s > %s", cpp_program, includes.val, defines.val, filename ? filename : "", tmpname3) == -1) fatal("%s: Out of memory\n", ProgramName); @@ -1219,7 +1219,7 @@ Process(int scrno, Bool doScreen, Bool execute) if (!(input = fopen(tmpname3, "r"))) fatal("%s: can't open file '%s'\n", ProgramName, tmpname3); #else - if (asprintf(&cmd, "%s%s %s %s", cpp_program, + if (asprintf(&cmd, "%s -P%s %s %s", cpp_program, includes.val, defines.val, filename ? filename : "") == -1) fatal("%s: Out of memory\n", ProgramName); -- cgit v1.2.3