Check-in [5dc6b2220b]
Overview
Comment:Cleaned up winMain

Updated main to return in failure if Tcl_Main() returns

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5dc6b2220bd5f4c7fcec1676fa5552aed77f51cb
User & Date: rkeene on 2010-09-26 04:46:35
Other Links: manifest | tags
Context
2010-09-26
04:46
Added StaticTk builds

Updated to move failed builds into failed directory check-in: fdb515dc70 user: rkeene tags: trunk

04:46
Cleaned up winMain

Updated main to return in failure if Tcl_Main() returns check-in: 5dc6b2220b user: rkeene tags: trunk

04:46
Fixed bug with zlib static linking check-in: 91b460f024 user: rkeene tags: trunk
Changes

Modified kitsh/buildsrc/kitsh-0.0/main.c from [f0d4d5a170] to [cac11ec6a8].

1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
#ifndef KITSH_NEED_WINMAIN
#include <tcl.h>

int TclKit_AppInit(Tcl_Interp *interp);

int main(int argc, char **argv) {
	Tcl_Interp *x;

	x = Tcl_CreateInterp();

	Tcl_Main(argc, argv, TclKit_AppInit);


	return(0);
}
#endif












>
|


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef KITSH_NEED_WINMAIN
#include <tcl.h>

int TclKit_AppInit(Tcl_Interp *interp);

int main(int argc, char **argv) {
	Tcl_Interp *x;

	x = Tcl_CreateInterp();

	Tcl_Main(argc, argv, TclKit_AppInit);

	/* If Tcl_Main() returns, something went wrong */
	return(1);
}
#endif

Modified kitsh/buildsrc/kitsh-0.0/winMain.c from [7676f90af4] to [34460f486a].

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * Forward declarations for procedures defined later in this file:
 */

static void		setargv _ANSI_ARGS_((int *argcPtr, char ***argvPtr));
static Tcl_PanicProc	WishPanic;

#ifdef TK_TEST
extern int		Tktest_Init(Tcl_Interp *interp);
#endif /* TK_TEST */

static BOOL consoleRequired = TRUE;

/*
 * The following #if block allows you to change the AppInit
 * function by using a #define of TCL_LOCAL_APPINIT instead
 * of rewriting this entire file.  The #if checks for that
 * #define and uses Tcl_AppInit if it doesn't exist.







<
<
<
<







32
33
34
35
36
37
38




39
40
41
42
43
44
45
/*
 * Forward declarations for procedures defined later in this file:
 */

static void		setargv _ANSI_ARGS_((int *argcPtr, char ***argvPtr));
static Tcl_PanicProc	WishPanic;





static BOOL consoleRequired = TRUE;

/*
 * The following #if block allows you to change the AppInit
 * function by using a #define of TCL_LOCAL_APPINIT instead
 * of rewriting this entire file.  The #if checks for that
 * #define and uses Tcl_AppInit if it doesn't exist.
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
	if (Dde_Init(interp) == TCL_ERROR) {
	    return TCL_ERROR;
	}
	Tcl_StaticPackage(interp, "dde", Dde_Init, NULL);
   }
#endif

#ifdef TK_TEST
    if (Tktest_Init(interp) == TCL_ERROR) {
	goto error;
    }
    Tcl_StaticPackage(interp, "Tktest", Tktest_Init,
            (Tcl_PackageInitProc *) NULL);
#endif /* TK_TEST */

    Tcl_SetVar(interp, "tcl_rcFileName", "~/wishrc.tcl", TCL_GLOBAL_ONLY);
    return TCL_OK;

error:
    MessageBeep(MB_ICONEXCLAMATION);
    MessageBox(NULL, Tcl_GetStringResult(interp), "Error in Wish",
	    MB_ICONSTOP | MB_OK | MB_TASKMODAL | MB_SETFOREGROUND);







<
<
<
<
<
<
<
<







206
207
208
209
210
211
212








213
214
215
216
217
218
219
	if (Dde_Init(interp) == TCL_ERROR) {
	    return TCL_ERROR;
	}
	Tcl_StaticPackage(interp, "dde", Dde_Init, NULL);
   }
#endif









    Tcl_SetVar(interp, "tcl_rcFileName", "~/wishrc.tcl", TCL_GLOBAL_ONLY);
    return TCL_OK;

error:
    MessageBeep(MB_ICONEXCLAMATION);
    MessageBox(NULL, Tcl_GetStringResult(interp), "Error in Wish",
	    MB_ICONSTOP | MB_OK | MB_TASKMODAL | MB_SETFOREGROUND);
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
	argSpace = arg + 1;
    }
    argv[argc] = NULL;

    *argcPtr = argc;
    *argvPtr = argv;
}

#if !defined(__GNUC__) || defined(TK_TEST)
/*
 *----------------------------------------------------------------------
 *
 * main --
 *
 *	Main entry point from the console.
 *
 * Results:
 *	None: Tk_Main never returns here, so this procedure never
 *      returns either.
 *
 * Side effects:
 *	Whatever the applications does.
 *
 *----------------------------------------------------------------------
 */

int main(int argc, char **argv)
{
    Tcl_SetPanicProc(WishPanic);

    /*
     * Set up the default locale to be standard "C" locale so parsing
     * is performed correctly.
     */
#ifndef UNDER_CE
    setlocale(LC_ALL, "C");
#endif

    /*
     * Create the console channels and install them as the standard
     * channels.  All I/O will be discarded until Tk_CreateConsoleWindow is
     * called to attach the console to a text widget.
     */

    consoleRequired = FALSE;

    Tk_Main(argc, argv, Tcl_AppInit);
    return 0;
}
#endif /* !__GNUC__ || TK_TEST */
#endif







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<
<
<
<
<
<
368
369
370
371
372
373
374





























375














	argSpace = arg + 1;
    }
    argv[argc] = NULL;

    *argcPtr = argc;
    *argvPtr = argv;
}





























#endif