This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: PATCH: Compiling libgui with Tk 8.3.
- To: Mo DeJong <mdejong at cygnus dot com>
- Subject: Re: PATCH: Compiling libgui with Tk 8.3.
- From: Keith Seitz <keiths at cygnus dot com>
- Date: Mon, 13 Aug 2001 17:26:28 -0700 (PDT)
- cc: <insight at sources dot redhat dot com>
On Mon, 13 Aug 2001, Mo DeJong wrote:
> 2001-08-12 Mo DeJong <mdejong@redhat.com>
>
> * src/tkCanvEdge.c: Work around Windows gcc problem
> initializing a static member with a dll imported
> symbol by assigning the function pointer at runtime.
> Static initialization works just fine in VC++ but
> fails when compiling with the Windows version of gcc.
Let's give it a try. (Does anyone use tkCanvEdge.c stuff?? I don't think
we do in Insight...)
Keith
>
> Index: src/tkCanvEdge.c
> ===================================================================
> RCS file: /cvs/cvsfiles/devo/libgui/src/tkCanvEdge.c,v
> retrieving revision 1.3
> retrieving revision 1.3.218.1
> diff -u -r1.3 -r1.3.218.1
> --- tkCanvEdge.c 1998/08/14 01:16:57 1.3
> +++ tkCanvEdge.c 2001/08/12 21:44:04 1.3.218.1
> @@ -179,9 +179,15 @@
> static Tk_CustomOption arrowShapeOption =
> { ParseArrowShape, PrintArrowShape, (ClientData) NULL};
>
> -static Tk_CustomOption tagsOption = {Tk_CanvasTagsParseProc,
> - Tk_CanvasTagsPrintProc, (ClientData) NULL};
> +/*
> + * The callbacks for tagsOption are initialized in ConfigureEdge()
> + */
>
> +static Tk_CustomOption tagsOption =
> +{ (Tk_OptionParseProc *) NULL,
> + (Tk_OptionPrintProc *) NULL,
> + (ClientData) NULL};
> +
> static Tk_ConfigSpec configSpecs[] = {
> {TK_CONFIG_UID, "-arrow", (char *) NULL, (char *) NULL,
> "none", Tk_Offset(EdgeItem, arrow), TK_CONFIG_DONT_SET_DEFAULT},
> @@ -530,6 +536,17 @@
>
> tkwin = Tk_CanvasTkwin(canvas);
> bgBorder = ((TkCanvas *) canvas)->bgBorder;
> +
> + /*
> + * Init callbacks in tagsOption before accessing configSpecs.
> + * This init can't be done statically when using Windows gcc
> + * since these symbols are imported from the Tk dll.
> + */
> +
> + if (tagsOption.parseProc == NULL) {
> + tagsOption.parseProc = Tk_CanvasTagsParseProc;
> + tagsOption.printProc = Tk_CanvasTagsPrintProc;
> + }
>
> if (Tk_ConfigureWidget(interp, tkwin,
> configSpecs, argc, argv,
>
>