+#if TCL_MAJOR_VERSION > 7 || (TCL_MAJOR_VERSION == 7 && TCL_MINOR_VERSION > 4)
+/* new version of tcl: version > 7.4 */
+extern int matherr ();
+int *tclDummyMathPtr = (int*) matherr;
+
+int main (int argc, char **argv)
+{
+ Tcl_Main (argc, argv, Tcl_AppInit);
+ return 0;
+}
+
+#else
+/* old version of tcl: version <= 7.4 */
+
+static char *fileName = NULL;
+extern int main ();
+int *tclDummyMainPtr = (int*) main;
+
+/* select(2) callbacks */
+struct callback {
+ void (*handle)(ClientData, int, int, int);
+ int r, w, e;
+ ClientData obj;
+};
+#define MAX_CALLBACK 200
+
+static struct callback callback_table[MAX_CALLBACK];
+static int max_fd = 3; /* don't worry: it will grow... */
+
+void tcl_mainloop (Tcl_Interp *interp, int interactive);
+