Update of /cvsroot/netrek/client/netrekxp/include
In directory sc8-pr-cvs16:/tmp/cvs-serv1445/include

Modified Files:
	data.h defs.h proto.h 
Log Message:
Terminate() calls within the network thread were causing errors due to
longjump() into the input thread.  A new function, terminate2() deals with
such cases.  Instead of calling longjump() directly, the main thread is
exited via W_TerminateWait() and ExitThread() calls, and a global error
variable is used to pass the exit code to setjmp in cowmain.c
This bit of code was previously used in death.c to handle jumping out
of the network thread to the main thread upon being sent to the team
select entry window.  All terminate() calls in socket.c have been modified
to use the appropriate version (terminate/terminate2) depending on
if THREADED is defined.

Index: defs.h
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/include/defs.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- defs.h	13 Apr 2007 07:12:20 -0000	1.23
+++ defs.h	28 Apr 2007 12:09:50 -0000	1.24
@@ -8,6 +8,8 @@
 
 #include "copyright.h"
 
+/* Error handling */
+#define RETURNBASE 10
 
 /* #$!@$#% length of address field of messages */
 #define ADDRLEN 10

Index: data.h
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/include/data.h,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- data.h	25 Apr 2007 07:21:42 -0000	1.82
+++ data.h	28 Apr 2007 12:09:50 -0000	1.83
@@ -176,6 +176,7 @@
 
 #endif
 
+extern int globalerr;
 extern int ingame;              /* If player is in game - to distinguish between whether
                                    to use double buffering on the local and map window */
 extern int ghoststart;

Index: proto.h
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/include/proto.h,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- proto.h	27 Apr 2007 10:04:18 -0000	1.53
+++ proto.h	28 Apr 2007 12:09:50 -0000	1.54
@@ -56,6 +56,9 @@
              char *name);
 // static RETSIGTYPE handle_exception(int _dummy);
 void terminate (int error);
+#ifdef THREADED
+void terminate2 (int error);
+#endif
 
 /******************************************************************************/
 /***  dashboard.c                                                           ***/