This is the mail archive of the
xconq7@sources.redhat.com
mailing list for the Xconq project.
compile fails for unix SDL (patch)
- From: tlow at low-shang dot homelinux dot com (Tom Low-Shang)
- To: xconq7 <xconq7 at sources dot redhat dot com>
- Date: Fri, 9 Jul 2004 13:45:06 -0400
- Subject: compile fails for unix SDL (patch)
Compiling the unix SDL interface fails because sdlunix.c
includes tcltk/tkconq.h. Below is the compiler output and a
patch to remove the references to Tcl/Tk and X data types and
functions.
Tom
make[1]: Entering directory `/usr/local/src/xconq/sdl'
gcc -c -g -O2 -DUNIX -I. -I./.. -I./../kernel -I./../missing -I/usr/include/SDL -D_REENTRANT -DHAVE_SELFILE sdlmain.c
gcc -c -g -O2 -DUNIX -I. -I./.. -I./../kernel -I./../missing -I/usr/include/SDL -D_REENTRANT -DHAVE_SELFILE sdlinit.c
gcc -c -g -O2 -DUNIX -I. -I./.. -I./../kernel -I./../missing -I/usr/include/SDL -D_REENTRANT -DHAVE_SELFILE sdlcmd.c
gcc -c -g -O2 -DUNIX -I. -I./.. -I./../kernel -I./../missing -I/usr/include/SDL -D_REENTRANT -DHAVE_SELFILE sdlscreen.c
gcc -c -g -O2 -DUNIX -I. -I./.. -I./../kernel -I./../missing -I/usr/include/SDL -D_REENTRANT -DHAVE_SELFILE sdlmap.c
gcc -c -g -O2 -DUNIX -I. -I./.. -I./../kernel -I./../missing -I/usr/include/SDL -D_REENTRANT -DHAVE_SELFILE sdlimf.c
rm -f libsdlui.a
ar rcu libsdlui.a sdlmain.o sdlinit.o sdlcmd.o sdlscreen.o sdlmap.o sdlimf.o
ranlib libsdlui.a
make[1]: Leaving directory `/usr/local/src/xconq/sdl'
make[1]: Entering directory `/usr/local/src/xconq/sdl'
gcc -c -g -O2 -DUNIX -I. -I./.. -I./../kernel -I./../missing -I/usr/include/SDL -D_REENTRANT -DHAVE_SELFILE sdlunix.c
In file included from sdlunix.c:13:
../tcltk/tkconq.h:21:17: tcl.h: No such file or directory
../tcltk/tkconq.h:22:16: tk.h: No such file or directory
In file included from ../tcltk/tkconq.h:33,
from sdlunix.c:13:
../tcltk/tkimf.h:14: error: parse error before "Tk_Window"
../tcltk/tkimf.h:14: warning: no semicolon at end of struct or union
../tcltk/tkimf.h:15: warning: data definition has no type or storage class
../tcltk/tkimf.h:19: error: parse error before "Pixmap"
../tcltk/tkimf.h:19: warning: no semicolon at end of struct or union
../tcltk/tkimf.h:20: warning: data definition has no type or storage class
../tcltk/tkimf.h:21: error: parse error before "mask"
../tcltk/tkimf.h:21: warning: data definition has no type or storage class
../tcltk/tkimf.h:22: error: parse error before '*' token
../tcltk/tkimf.h:22: warning: data definition has no type or storage class
../tcltk/tkimf.h:23: error: parse error before '*' token
../tcltk/tkimf.h:23: warning: data definition has no type or storage class
../tcltk/tkimf.h:24: error: parse error before '}' token
../tcltk/tkimf.h:24: warning: data definition has no type or storage class
../tcltk/tkimf.h:44: error: parse error before '*' token
../tcltk/tkimf.h:44: warning: data definition has no type or storage class
../tcltk/tkimf.h:45: error: parse error before '*' token
../tcltk/tkimf.h:45: warning: data definition has no type or storage class
../tcltk/tkimf.h:50: error: parse error before "cldata"
In file included from sdlunix.c:13:
../tcltk/tkconq.h:103: error: parse error before "Display"
../tcltk/tkconq.h:103: warning: no semicolon at end of struct or union
../tcltk/tkconq.h:114: error: parse error before '*' token
../tcltk/tkconq.h:114: warning: data definition has no type or storage class
../tcltk/tkconq.h:115: error: parse error before '*' token
../tcltk/tkconq.h:115: warning: data definition has no type or storage class
../tcltk/tkconq.h:116: error: parse error before '*' token
../tcltk/tkconq.h:116: warning: data definition has no type or storage class
../tcltk/tkconq.h:117: error: parse error before '*' token
../tcltk/tkconq.h:117: warning: data definition has no type or storage class
../tcltk/tkconq.h:118: error: parse error before '*' token
../tcltk/tkconq.h:118: warning: data definition has no type or storage class
../tcltk/tkconq.h:119: error: parse error before '*' token
../tcltk/tkconq.h:119: warning: data definition has no type or storage class
../tcltk/tkconq.h:120: error: parse error before '*' token
../tcltk/tkconq.h:120: warning: data definition has no type or storage class
../tcltk/tkconq.h:121: error: parse error before '*' token
../tcltk/tkconq.h:121: warning: data definition has no type or storage class
../tcltk/tkconq.h:122: error: parse error before '*' token
../tcltk/tkconq.h:122: warning: data definition has no type or storage class
../tcltk/tkconq.h:123: error: parse error before '*' token
../tcltk/tkconq.h:123: warning: data definition has no type or storage class
../tcltk/tkconq.h:124: error: parse error before '*' token
../tcltk/tkconq.h:124: warning: data definition has no type or storage class
../tcltk/tkconq.h:125: error: parse error before '*' token
../tcltk/tkconq.h:125: warning: data definition has no type or storage class
../tcltk/tkconq.h:126: error: parse error before '*' token
../tcltk/tkconq.h:126: warning: data definition has no type or storage class
../tcltk/tkconq.h:127: error: parse error before '*' token
../tcltk/tkconq.h:127: warning: data definition has no type or storage class
../tcltk/tkconq.h:128: error: parse error before '*' token
../tcltk/tkconq.h:128: warning: data definition has no type or storage class
../tcltk/tkconq.h:129: error: parse error before '*' token
../tcltk/tkconq.h:129: warning: data definition has no type or storage class
../tcltk/tkconq.h:130: error: parse error before '*' token
../tcltk/tkconq.h:130: warning: data definition has no type or storage class
../tcltk/tkconq.h:131: error: parse error before '*' token
../tcltk/tkconq.h:131: warning: data definition has no type or storage class
../tcltk/tkconq.h:132: error: parse error before '*' token
../tcltk/tkconq.h:132: warning: data definition has no type or storage class
../tcltk/tkconq.h:133: error: parse error before '*' token
../tcltk/tkconq.h:133: warning: data definition has no type or storage class
../tcltk/tkconq.h:134: error: parse error before '*' token
../tcltk/tkconq.h:134: warning: data definition has no type or storage class
../tcltk/tkconq.h:135: error: parse error before '*' token
../tcltk/tkconq.h:135: warning: data definition has no type or storage class
../tcltk/tkconq.h:136: error: parse error before '*' token
../tcltk/tkconq.h:136: warning: data definition has no type or storage class
../tcltk/tkconq.h:137: error: parse error before '*' token
../tcltk/tkconq.h:137: warning: data definition has no type or storage class
../tcltk/tkconq.h:138: error: parse error before '*' token
../tcltk/tkconq.h:138: warning: data definition has no type or storage class
../tcltk/tkconq.h:139: error: parse error before '*' token
../tcltk/tkconq.h:139: warning: data definition has no type or storage class
../tcltk/tkconq.h:141: error: parse error before '*' token
../tcltk/tkconq.h:141: warning: data definition has no type or storage class
../tcltk/tkconq.h:142: error: parse error before '*' token
../tcltk/tkconq.h:142: warning: data definition has no type or storage class
../tcltk/tkconq.h:191: error: parse error before '*' token
../tcltk/tkconq.h:191: warning: data definition has no type or storage class
../tcltk/tkconq.h:192: error: parse error before "hexpics"
../tcltk/tkconq.h:192: warning: data definition has no type or storage class
../tcltk/tkconq.h:193: error: parse error before "hexisopics"
../tcltk/tkconq.h:193: warning: data definition has no type or storage class
../tcltk/tkconq.h:195: error: parse error before "emblempics"
../tcltk/tkconq.h:195: warning: data definition has no type or storage class
../tcltk/tkconq.h:196: error: parse error before "emblemmasks"
../tcltk/tkconq.h:196: warning: data definition has no type or storage class
../tcltk/tkconq.h:206: error: parse error before "grays"
../tcltk/tkconq.h:206: warning: data definition has no type or storage class
../tcltk/tkconq.h:207: error: parse error before "dots"
../tcltk/tkconq.h:207: warning: data definition has no type or storage class
../tcltk/tkconq.h:208: error: parse error before "cursors"
../tcltk/tkconq.h:208: warning: data definition has no type or storage class
../tcltk/tkconq.h:213: error: parse error before '}' token
../tcltk/tkconq.h:213: warning: data definition has no type or storage class
../tcltk/tkconq.h:269: error: parse error before '*' token
../tcltk/tkconq.h:269: warning: data definition has no type or storage class
sdlunix.c:26: error: parse error before '*' token
sdlunix.c:27: error: parse error before '*' token
sdlunix.c:199: error: parse error before '*' token
sdlunix.c: In function `handle_x_error':
sdlunix.c:204: error: `dpy' undeclared (first use in this function)
sdlunix.c:204: error: (Each undeclared identifier is reported only once
sdlunix.c:204: error: for each function it appears in.)
sdlunix.c:204: error: `evt' undeclared (first use in this function)
sdlunix.c: At top level:
sdlunix.c:230: error: parse error before '*' token
sdlunix.c: In function `handle_xio_error':
sdlunix.c:233: error: `dpy' undeclared (first use in this function)
make[1]: *** [sdlunix.o] Error 1
make[1]: Leaving directory `/usr/local/src/xconq/sdl'
make: *** [all-sdlconq] Error 2
Index: sdlunix.c
===================================================================
RCS file: /cvs/xconq/xconq/sdl/sdlunix.c,v
retrieving revision 1.1
diff -u -r1.1 sdlunix.c
--- sdlunix.c 15 Sep 2003 00:06:17 -0000 1.1
+++ sdlunix.c 9 Jul 2004 16:38:51 -0000
@@ -9,8 +9,7 @@
#include "conq.h"
#include "kpublic.h"
#include "cmdline.h"
-
-#include "tcltk/tkconq.h"
+#include "sdlconq.h"
extern int use_stdio;
@@ -23,8 +22,6 @@
/* Local function declarations. */
static void accept_all_remotes(void);
-static int handle_x_error(Display *dpy, XErrorEvent *evt);
-static int handle_xio_error(Display *dpy);
/* The main program. */
@@ -185,57 +182,3 @@
}
}
}
-
-void
-init_x_signal_handlers(void)
-{
- XSetErrorHandler(handle_x_error);
- XSetIOErrorHandler(handle_xio_error);
-}
-
-/* Handlers for X catastrophes attempt to do a save first. */
-
-static int
-handle_x_error (Display *dpy, XErrorEvent *evt)
-{
- static int num_errors = 0;
- char buf[BUFSIZE];
-
- XGetErrorText(dpy, evt->error_code, buf, BUFSIZE);
- fprintf(stderr, "\nX error on display %s: %s\n", DisplayString(dpy), buf);
-
-#if 0 /* This code caused the program to crash every time a Tcl dialog
- or window had been dismissed more than 5 times. The reason is
- that two harmless x errors, BadWindow and BadDrawable,are
- generated every time Tcl uses the "wm withdraw" command. */
-
- if (++num_errors >= 10) {
- printf("\nX error: trying emergency save!\n");
- /* Note that if the save fails too, we're totally hosed. */
- /* (should use configurable name here) */
- write_entire_game_state("ack!.xconq");
-#ifdef __cplusplus
- throw "snafu";
-#else
- abort();
-#endif
- }
-
-#endif /* End of auto-crashing code. */
-
- return 0;
-}
-
-static int
-handle_xio_error (Display *dpy)
-{
- fprintf(stderr, "\nX IO error on display %s: trying emergency save!\n",
- DisplayString(dpy));
- write_entire_game_state("ack!.xconq");
-#ifdef __cplusplus
- throw "snafu";
-#else
- abort();
-#endif
- return 0;
-}
Index: sdlmain.c
===================================================================
RCS file: /cvs/xconq/xconq/sdl/sdlmain.c,v
retrieving revision 1.41
diff -u -r1.41 sdlmain.c
--- sdlmain.c 22 Dec 2003 01:08:11 -0000 1.41
+++ sdlmain.c 9 Jul 2004 16:38:57 -0000
@@ -2530,9 +2530,6 @@
init_redraws();
/* Set up the signal handlers. */
init_signal_handlers();
-#ifdef UNIX
- init_x_signal_handlers();
-#endif
/* (should notify players of all the game options in effect) */
notify_instructions();
/* Do first set of turn calcs, but let the host lead the way. */