[PATCH xrdb] Get rid of PATHETICCPP macro
Mikhail Gusarov
dottedmag at dottedmag.net
Sat Oct 9 09:47:35 PDT 2010
This macro was undefined since 7.0. Generated by unifdef -UPATHETICCPP
Signed-off-by: Mikhail Gusarov <dottedmag at dottedmag.net>
---
xrdb.c | 105 ----------------------------------------------------------------
1 files changed, 0 insertions(+), 105 deletions(-)
diff --git a/xrdb.c b/xrdb.c
index 21005c0..3c15faa 100644
--- a/xrdb.c
+++ b/xrdb.c
@@ -117,13 +117,6 @@ static char *ProgramName;
static Bool quiet = False;
static char tmpname[32];
static char *filename = NULL;
-#ifdef PATHETICCPP
-static Bool need_real_defines = False;
-static char tmpname2[32];
-#ifdef WIN32
-static char tmpname3[32];
-#endif
-#endif
static int oper = OPLOAD;
static char *editFile = NULL;
static const char *cpp_program = NULL;
@@ -373,17 +366,6 @@ ReadFile(Buffer *buffer, FILE *input)
static void
AddDef(String *buff, char *title, char *value)
{
-#ifdef PATHETICCPP
- if (need_real_defines) {
- addstring(buff, "\n#define ");
- addstring(buff, title);
- if (value && (value[0] != '\0')) {
- addstring(buff, " ");
- addstring(buff, value);
- }
- return;
- }
-#endif
if (buff->used) {
if (oper == OPSYMBOLS)
addstring(buff, "\n-D");
@@ -401,11 +383,6 @@ AddDef(String *buff, char *title, char *value)
static void
AddDefQ(String *buff, char *title, char *value)
{
-#ifdef PATHETICCPP
- if (need_real_defines)
- AddDef(buff, title, value);
- else
-#endif
if (value && (value[0] != '\0')) {
AddDef(buff, title, "\"");
addstring(buff, value);
@@ -446,13 +423,6 @@ AddDefTok(String *buff, char *prefix, char *title)
static void
AddUndef(String *buff, char *title)
{
-#ifdef PATHETICCPP
- if (need_real_defines) {
- addstring(buff, "\n#undef ");
- addstring(buff, title);
- return;
- }
-#endif
if (buff->used) {
if (oper == OPSYMBOLS)
addstring(buff, "\n-U");
@@ -901,34 +871,10 @@ main(int argc, char *argv[])
if (whichResources == RALL && ScreenCount(dpy) == 1)
whichResources = RGLOBAL;
-#ifdef PATHETICCPP
- if (cpp_program &&
- (oper == OPLOAD || oper == OPMERGE || oper == OPOVERRIDE)) {
- need_real_defines = True;
-#ifdef WIN32
- strcpy(tmpname2, "xrdbD_XXXXXX");
- strcpy(tmpname3, "\\temp\\xrdbD_XXXXXX");
-#else
-#ifdef __UNIXOS2__
- { char *tmpdir=getenv("TMP");
- if (!tmpdir) tmpdir="/";
- sprintf(tmpname2, "%s/xrdbD_XXXXXX",tmpdir);
- }
-#else
- strcpy(tmpname2, "/tmp/xrdbD_XXXXXX");
-#endif
-#endif
- (void) mktemp(tmpname2);
- }
-#endif
if (!filename &&
-#ifdef PATHETICCPP
- need_real_defines
-#else
(oper == OPLOAD || oper == OPMERGE || oper == OPOVERRIDE) &&
(whichResources == RALL || whichResources == RSCREENS)
-#endif
) {
char inputbuf[1024];
#ifdef WIN32
@@ -1153,45 +1099,6 @@ Process(int scrno, Bool doScreen, Bool execute)
} else {
if (oper == OPMERGE || oper == OPOVERRIDE)
GetEntriesString(&newDB, xdefs);
-#ifdef PATHETICCPP
- if (need_real_defines) {
-#ifdef WIN32
- if (!(input = fopen(tmpname2, "w")))
- fatal("%s: can't open file '%s'\n", ProgramName, tmpname2);
- fputs(defines.val, input);
- fprintf(input, "\n#include \"%s\"\n", filename);
- fclose(input);
- (void) mktemp(tmpname3);
- if((cmd = (char *)
- malloc(strlen(cpp_program) + strlen(includes.val) +
- 1 + strlen(tmpname2) + 3 + strlen(tmpname3) + 1)) ==
- NULL)
- fatal("%s: Out of memory\n", ProgramName);
- sprintf(cmd, "%s%s %s > %s", cpp_program, includes.val,
- tmpname2, tmpname3);
- if (system(cmd) < 0)
- fatal("%s: cannot run '%s'\n", ProgramName, cmd);
- free(cmd);
- if (!(input = fopen(tmpname3, "r")))
- fatal("%s: can't open file '%s'\n", ProgramName, tmpname3);
-#else
- if (!freopen(tmpname2, "w+", stdin))
- fatal("%s: can't open file '%s'\n", ProgramName, tmpname2);
- fputs(defines.val, stdin);
- fprintf(stdin, "\n#include \"%s\"\n", filename);
- fflush(stdin);
- fseek(stdin, 0, 0);
- if((cmd = (char *)
- malloc(strlen(cpp_program) + strlen(includes.val) + 1)) ==
- NULL)
- fatal("%s: Out of memory\n", ProgramName);
- sprintf(cmd, "%s%s", cpp_program, includes.val);
- if (!(input = popen(cmd, "r")))
- fatal("%s: cannot run '%s'\n", ProgramName, cmd);
- free(cmd);
-#endif
- } else {
-#endif
if (filename) {
if (!freopen (filename, "r", stdin))
fatal("%s: can't open file '%s'\n", ProgramName, filename);
@@ -1231,9 +1138,6 @@ Process(int scrno, Bool doScreen, Bool execute)
} else {
input = stdin;
}
-#ifdef PATHETICCPP
- }
-#endif
ReadFile(&buffer, input);
if (cpp_program) {
#ifdef WIN32
@@ -1242,15 +1146,6 @@ Process(int scrno, Bool doScreen, Bool execute)
pclose(input);
#endif
}
-#ifdef PATHETICCPP
- if (need_real_defines) {
- unlink(tmpname2);
-#ifdef WIN32
- if (tmpname3[strlen(tmpname3) - 1] != 'X')
- unlink(tmpname3);
-#endif
- }
-#endif
GetEntries(&newDB, &buffer, 0);
if (execute) {
FormatEntries(&buffer, &newDB);
--
1.7.1
More information about the xorg-devel
mailing list