[eggheads-patches] PATCH: tcl-version-checking.diff

Tothwolf tothwolf at concentric.net
Thu Oct 7 14:36:23 CST 1999


tcl-version-checking.diff - sanity checking for the 3 Tcl functions used
                            in eggdrop that are for Tcl7.5 and newer.
-------------- next part --------------
Index: src/eggdrop.h
===================================================================
RCS file: /usr/local/cvsroot/eggdrop1.3/src/eggdrop.h,v
retrieving revision 1.6
diff -u -r1.6 eggdrop.h
--- src/eggdrop.h	1999/09/26 23:14:24	1.6
+++ src/eggdrop.h	1999/10/07 13:58:24
@@ -68,7 +68,7 @@
 #endif
 
 #if (NICKMAX < 9) || (NICKMAX > 32)
-#include "invalid NIXMAX value"
+#include "invalid NICKMAX value"
 #endif
 
 #if (HANDLEN < 9) || (HANDLEN > 32)
@@ -142,11 +142,11 @@
 #define free(x) dont_use_old_free(x)
 
 /* IP type */
-#if SIZEOF_INT==4
+#if (SIZEOF_INT == 4)
 typedef unsigned int IP;
 
 #else
-#if SIZEOF_LONG==4
+#if (SIZEOF_LONG == 4)
 typedef unsigned long IP;
 
 #else
Index: src/main.c
===================================================================
RCS file: /usr/local/cvsroot/eggdrop1.3/src/main.c,v
retrieving revision 1.13
diff -u -r1.13 main.c
--- src/main.c	1999/09/26 23:14:24	1.13
+++ src/main.c	1999/10/07 13:58:28
@@ -738,8 +738,10 @@
     int socket_cleanup = 0;
 
     context;
+#if ((TCL_MAJOR_VERSION == 7) && (TCL_MINOR_VERSION >= 5)) || (TCL_MAJOR_VERSION >= 8)
     /* process a single tcl event */
     Tcl_DoOneEvent(TCL_ALL_EVENTS | TCL_DONT_WAIT);
+#endif				/* TCL */
     /* lets move some of this here, reducing the numer of actual
      * calls to periodic_timers */
     now = time(NULL);
Index: src/modules.c
===================================================================
RCS file: /usr/local/cvsroot/eggdrop1.3/src/modules.c,v
retrieving revision 1.10
diff -u -r1.10 modules.c
--- src/modules.c	1999/09/26 18:46:18	1.10
+++ src/modules.c	1999/10/07 13:58:30
@@ -587,9 +587,11 @@
     return "Can't load module.";
 #else
 #ifdef OSF1_HACKS
+#if ((TCL_MAJOR_VERSION == 7) && (TCL_MINOR_VERSION >= 5)) || (TCL_MAJOR_VERSION >= 8)
   hand = (Tcl_PackageInitProc *) load(workbuf, LDR_NOFLAGS);
   if (hand == LDR_NULL_MODULE)
     return "Can't load module.";
+#endif				/* TCL */
 #else
   context;
   hand = dlopen(workbuf, DLFLAGS);
Index: src/tcl.c
===================================================================
RCS file: /usr/local/cvsroot/eggdrop1.3/src/tcl.c,v
retrieving revision 1.14
diff -u -r1.14 tcl.c
--- src/tcl.c	1999/10/04 21:25:44	1.14
+++ src/tcl.c	1999/10/07 13:58:38
@@ -476,14 +476,16 @@
   add_tcl_commands(tcluser_cmds);
   add_tcl_commands(tcldcc_cmds);
   add_tcl_commands(tclmisc_cmds);
-
   Tcl_CreateCommand(interp, "logfile", tcl_logfile, NULL, NULL);
+#if ((TCL_MAJOR_VERSION == 7) && (TCL_MINOR_VERSION >= 5)) || (TCL_MAJOR_VERSION >= 8)
+  /* add eggdrop to Tcl's package list */
   for (i = 0; i <= strlen(egg_version); i++) {
     if ((egg_version[i] == ' ') || (egg_version[i] == '+'))
       break;
     pver[strlen(pver)] = egg_version[i];
   }
   Tcl_PkgProvide(interp, "eggdrop", pver);
+#endif				/* TCL */
 }
 
 /**********************************************************************/


More information about the Patches mailing list