From 03ceba547a22b69f50f302e737f783597d7f9276 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 13 Apr 2012 19:34:11 +0000 Subject: [Bug 3517448] TclKit build fails (unresolved __strtoi64) some more tkInt.decls formatting --- ChangeLog | 5 +++++ generic/tkInt.decls | 4 ++-- generic/tkIntDecls.h | 8 ++++---- win/rules.vc | 11 +++++++---- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 54ab679..b4ac558 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-04-13 Jan Nijtmans + + * win/rules.vc: [Bug 3517448] TclKit build fails (unresolved + __strtoi64) + 2012-04-07 Jan Nijtmans * generic/tkBind.c: [Bug 3176239] control-MouseWheel causes segv diff --git a/generic/tkInt.decls b/generic/tkInt.decls index e1f4ffc..68b8788 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -223,7 +223,7 @@ declare 57 { void TkpClaimFocus(TkWindow *topLevelPtr, int force) } declare 58 { - void TkpDisplayWarning( const char *msg, const char *title) + void TkpDisplayWarning(const char *msg, const char *title) } declare 59 { void TkpGetAppName(Tcl_Interp *interp, Tcl_DString *name) @@ -254,7 +254,7 @@ declare 67 { void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp, char *menuName) } declare 68 { - TkDisplay *TkpOpenDisplay( const char *display_name) + TkDisplay *TkpOpenDisplay(const char *display_name) } declare 69 { int TkPointerEvent(XEvent *eventPtr, TkWindow *winPtr) diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index 280e6c8..3654621 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -143,7 +143,7 @@ EXTERN CONST84_RETURN char * TkGetDefaultScreenName _ANSI_ARGS_(( EXTERN TkDisplay * TkGetDisplay _ANSI_ARGS_((Display *display)); /* 35 */ EXTERN int TkGetDisplayOf _ANSI_ARGS_((Tcl_Interp *interp, - int objc, Tcl_Obj * CONST objv[], + int objc, Tcl_Obj *CONST objv[], Tk_Window *tkwinPtr)); /* 36 */ EXTERN TkWindow * TkGetFocusWin _ANSI_ARGS_((TkWindow *winPtr)); @@ -235,7 +235,7 @@ EXTERN Window TkpMakeWindow _ANSI_ARGS_((TkWindow *winPtr, Window parent)); /* 67 */ EXTERN void TkpMenuNotifyToplevelCreate _ANSI_ARGS_(( - Tcl_Interp *interp1, char *menuName)); + Tcl_Interp *interp, char *menuName)); /* 68 */ EXTERN TkDisplay * TkpOpenDisplay _ANSI_ARGS_((CONST char *display_name)); /* 69 */ @@ -602,7 +602,7 @@ typedef struct TkIntStubs { TkCursor * (*tkGetCursorByName) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid string)); /* 32 */ CONST84_RETURN char * (*tkGetDefaultScreenName) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *screenName)); /* 33 */ TkDisplay * (*tkGetDisplay) _ANSI_ARGS_((Display *display)); /* 34 */ - int (*tkGetDisplayOf) _ANSI_ARGS_((Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[], Tk_Window *tkwinPtr)); /* 35 */ + int (*tkGetDisplayOf) _ANSI_ARGS_((Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tk_Window *tkwinPtr)); /* 35 */ TkWindow * (*tkGetFocusWin) _ANSI_ARGS_((TkWindow *winPtr)); /* 36 */ int (*tkGetInterpNames) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin)); /* 37 */ int (*tkGetMiterPoints) _ANSI_ARGS_((double p1[], double p2[], double p3[], double width, double m1[], double m2[])); /* 38 */ @@ -634,7 +634,7 @@ typedef struct TkIntStubs { void (*tkpMakeContainer) _ANSI_ARGS_((Tk_Window tkwin)); /* 64 */ void (*tkpMakeMenuWindow) _ANSI_ARGS_((Tk_Window tkwin, int transient)); /* 65 */ Window (*tkpMakeWindow) _ANSI_ARGS_((TkWindow *winPtr, Window parent)); /* 66 */ - void (*tkpMenuNotifyToplevelCreate) _ANSI_ARGS_((Tcl_Interp *interp1, char *menuName)); /* 67 */ + void (*tkpMenuNotifyToplevelCreate) _ANSI_ARGS_((Tcl_Interp *interp, char *menuName)); /* 67 */ TkDisplay * (*tkpOpenDisplay) _ANSI_ARGS_((CONST char *display_name)); /* 68 */ int (*tkPointerEvent) _ANSI_ARGS_((XEvent *eventPtr, TkWindow *winPtr)); /* 69 */ int (*tkPolygonToArea) _ANSI_ARGS_((double *polyPtr, int numPoints, double *rectPtr)); /* 70 */ diff --git a/win/rules.vc b/win/rules.vc index b813668..69f9fc8 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -426,18 +426,21 @@ OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_ALLOC=1 OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD !endif -!if $(DEBUG) -OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DEBUG -!elseif $(OPTIMIZING) +!if !$(DEBUG) +OPTDEFINES = $(OPTDEFINES) -DNDEBUG +!if $(OPTIMIZING) OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_OPTIMIZED !endif +!endif !if $(PROFILE) OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_PROFILED !endif !if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DO64BIT !endif - +!if $(VCVERSION) < 1300 +OPTDEFINES = $(OPTDEFINES) -DNO_STRTOI64 +!endif #---------------------------------------------------------- # Get common info used when building extensions. -- cgit v0.12 From 31f6b36e6e188b6b5c7a5007b15b99100b597bab Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 16 Apr 2012 22:23:17 +0000 Subject: Fix bug 533519 --- library/bgerror.tcl | 5 +++-- library/choosedir.tcl | 2 +- library/clrpick.tcl | 2 +- library/dialog.tcl | 22 ++-------------------- library/msgbox.tcl | 2 +- library/tk.tcl | 20 ++++++++------------ library/tkfbox.tcl | 2 +- win/tkWinWm.c | 17 ++++------------- 8 files changed, 21 insertions(+), 51 deletions(-) diff --git a/library/bgerror.tcl b/library/bgerror.tcl index 4ecabd8..06c72a1 100644 --- a/library/bgerror.tcl +++ b/library/bgerror.tcl @@ -242,8 +242,9 @@ proc ::tk::dialog::error::bgerror err { bind .bgerrorDialog [namespace code [list Destroy %W]] .bgerrorDialog.function configure -command [namespace code Details] - # 6. Update all the geometry information so we know how big it wants - # to be, then center the window in the display and deiconify it. + # 6. Withdraw the window, then update all the geometry information + # so we know how big it wants to be, then center the window in the + # display (Motif style) and de-iconify it. ::tk::PlaceWindow .bgerrorDialog diff --git a/library/choosedir.tcl b/library/choosedir.tcl index b9c2aa8..0fd3f01 100644 --- a/library/choosedir.tcl +++ b/library/choosedir.tcl @@ -79,7 +79,7 @@ proc ::tk::dialog::file::chooseDir:: {args} { # Withdraw the window, then update all the geometry information # so we know how big it wants to be, then center the window in the - # display and de-iconify it. + # display (Motif style) and de-iconify it. ::tk::PlaceWindow $w widget $data(-parent) wm title $w $data(-title) diff --git a/library/clrpick.tcl b/library/clrpick.tcl index cfbfb4f..02793cc 100644 --- a/library/clrpick.tcl +++ b/library/clrpick.tcl @@ -89,7 +89,7 @@ proc ::tk::dialog::color:: {args} { # 5. Withdraw the window, then update all the geometry information # so we know how big it wants to be, then center the window in the - # display and de-iconify it. + # display (Motif style) and de-iconify it. ::tk::PlaceWindow $w widget $data(-parent) wm title $w $data(-title) diff --git a/library/dialog.tcl b/library/dialog.tcl index 04acb3b..1ec578e 100644 --- a/library/dialog.tcl +++ b/library/dialog.tcl @@ -152,27 +152,9 @@ proc ::tk_dialog {w title text bitmap default args} { # 6. Withdraw the window, then update all the geometry information # so we know how big it wants to be, then center the window in the - # display and de-iconify it. - - wm withdraw $w - update idletasks - set x [expr {[winfo screenwidth $w]/2 - [winfo reqwidth $w]/2 \ - - [winfo vrootx [winfo parent $w]]}] - set y [expr {[winfo screenheight $w]/2 - [winfo reqheight $w]/2 \ - - [winfo vrooty [winfo parent $w]]}] - # Make sure that the window is on the screen and set the maximum - # size of the window is the size of the screen. That'll let things - # fail fairly gracefully when very large messages are used. [Bug 827535] - if {$x < 0} { - set x 0 - } - if {$y < 0} { - set y 0 - } - wm maxsize $w [winfo screenwidth $w] [winfo screenheight $w] - wm geometry $w +$x+$y - wm deiconify $w + # display (Motif style) and de-iconify it. + ::tk::PlaceWindow $w tkwait visibility $w # 7. Set a grab and claim the focus too. diff --git a/library/msgbox.tcl b/library/msgbox.tcl index 2a22d54..e5a363d 100644 --- a/library/msgbox.tcl +++ b/library/msgbox.tcl @@ -406,7 +406,7 @@ proc ::tk::MessageBox {args} { # 7. Withdraw the window, then update all the geometry information # so we know how big it wants to be, then center the window in the - # display and de-iconify it. + # display (Motif style) and de-iconify it. ::tk::PlaceWindow $w widget $data(-parent) diff --git a/library/tk.tcl b/library/tk.tcl index b9c3872..1935bbc 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -106,20 +106,16 @@ proc ::tk::PlaceWindow {w {place ""} {anchor ""}} { set windowingsystem [tk windowingsystem] - if {$windowingsystem eq "win32"} { - # Bug 533519: win32 multiple desktops may produce negative geometry. - set checkBounds 0 - } if {$checkBounds} { - if {$x < 0} { - set x 0 - } elseif {$x > ([winfo screenwidth $w]-[winfo reqwidth $w])} { - set x [expr {[winfo screenwidth $w]-[winfo reqwidth $w]}] + if {$x < [winfo vrootx $w]} { + set x [winfo vrootx $w] + } elseif {$x > ([winfo vrootx $w]+[winfo vrootwidth $w]-[winfo reqwidth $w])} { + set x [expr {[winfo vrootx $w]+[winfo vrootwidth $w]-[winfo reqwidth $w]}] } - if {$y < 0} { - set y 0 - } elseif {$y > ([winfo screenheight $w]-[winfo reqheight $w])} { - set y [expr {[winfo screenheight $w]-[winfo reqheight $w]}] + if {$y < [winfo vrooty $w]} { + set y [winfo vrooty $w] + } elseif {$y > ([winfo vrooty $w]+[winfo vrootheight $w]-[winfo reqheight $w])} { + set y [expr {[winfo vrooty $w]+[winfo vrootheight $w]-[winfo reqheight $w]}] } if {$windowingsystem eq "classic" || $windowingsystem eq "aqua"} { # Avoid the native menu bar which sits on top of everything. diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl index b778bd0..bf6cf87 100644 --- a/library/tkfbox.tcl +++ b/library/tkfbox.tcl @@ -869,7 +869,7 @@ proc ::tk::dialog::file:: {type args} { # Withdraw the window, then update all the geometry information # so we know how big it wants to be, then center the window in the - # display and de-iconify it. + # display (Motif style) and de-iconify it. ::tk::PlaceWindow $w widget $data(-parent) wm title $w $data(-title) diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 2097938..59287c8 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -5994,19 +5994,10 @@ Tk_GetVRootGeometry(tkwin, xPtr, yPtr, widthPtr, heightPtr) * here. */ int *widthPtr, *heightPtr; /* Store dimensions of virtual root here. */ { - TkWindow *winPtr = (TkWindow *) tkwin; - - /* - * XXX: This is not correct for multiple monitors. There may be many - * changes required to get this right, and it may effect existing - * applications that don't consider possible <0 vroot. See - * http://msdn.microsoft.com/library/en-us/gdi/monitor_3lrn.asp - * for more info. - */ - *xPtr = 0; - *yPtr = 0; - *widthPtr = DisplayWidth(winPtr->display, winPtr->screenNum); - *heightPtr = DisplayHeight(winPtr->display, winPtr->screenNum); + *xPtr = GetSystemMetrics(SM_XVIRTUALSCREEN); + *yPtr = GetSystemMetrics(SM_YVIRTUALSCREEN); + *widthPtr = GetSystemMetrics(SM_CXVIRTUALSCREEN); + *heightPtr = GetSystemMetrics(SM_CYVIRTUALSCREEN); } /* -- cgit v0.12 From f4876885b53d6ed34fb1c3577e0c2d238a871953 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 16 Apr 2012 22:26:50 +0000 Subject: set [wm maxsize] as well --- library/tk.tcl | 1 + 1 file changed, 1 insertion(+) diff --git a/library/tk.tcl b/library/tk.tcl index 1935bbc..57525f1 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -122,6 +122,7 @@ proc ::tk::PlaceWindow {w {place ""} {anchor ""}} { if {$y < 22} { set y 22 } } } + wm maxsize $w [winfo vrootwidth $w] [winfo vrootheight $w] wm geometry $w +$x+$y wm deiconify $w } -- cgit v0.12 From 15bcec02d97d8789fa796cabdc76859618f22387 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 17 Apr 2012 21:12:16 +0000 Subject: make loading of tk.dll in cygwin possible reduce command table size --- generic/tkWindow.c | 127 ++++++++++++++++++++++++++--------------------------- unix/Makefile.in | 11 ++++- 2 files changed, 71 insertions(+), 67 deletions(-) diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 422b27e..d3de72d 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -69,14 +69,14 @@ TCL_DECLARE_MUTEX(windowMutex) * events on internal windows: these events are generated internally. */ -static XWindowChanges defChanges = { +static CONST XWindowChanges defChanges = { 0, 0, 1, 1, 0, 0, Above }; #define ALL_EVENTS_MASK \ KeyPressMask|KeyReleaseMask|ButtonPressMask|ButtonReleaseMask| \ EnterWindowMask|LeaveWindowMask|PointerMotionMask|ExposureMask| \ VisibilityChangeMask|PropertyChangeMask|ColormapChangeMask -static XSetWindowAttributes defAtts= { +static CONST XSetWindowAttributes defAtts= { None, /* background_pixmap */ 0, /* background_pixel */ CopyFromParent, /* border_pixmap */ @@ -99,77 +99,74 @@ static XSetWindowAttributes defAtts= { * Tk, and the C procedures that execute them. */ +#define ISSAFE 1 +#define PASSMAINWINDOW 2 + typedef struct { - char *name; /* Name of command. */ + CONST char *name; /* Name of command. */ Tcl_CmdProc *cmdProc; /* Command's string-based procedure. */ Tcl_ObjCmdProc *objProc; /* Command's object-based procedure. */ - int isSafe; /* If !0, this command will be exposed in - * a safe interpreter. Otherwise it will be - * hidden in a safe interpreter. */ - int passMainWindow; /* 0 means provide NULL clientData to - * command procedure; 1 means pass main - * window as clientData to command - * procedure. */ + int flags; } TkCmd; -static TkCmd commands[] = { +static CONST TkCmd commands[] = { /* * Commands that are part of the intrinsics: */ - {"bell", NULL, Tk_BellObjCmd, 0, 1}, - {"bind", NULL, Tk_BindObjCmd, 1, 1}, - {"bindtags", NULL, Tk_BindtagsObjCmd, 1, 1}, - {"clipboard", NULL, Tk_ClipboardObjCmd, 0, 1}, - {"destroy", NULL, Tk_DestroyObjCmd, 1, 1}, - {"event", NULL, Tk_EventObjCmd, 1, 1}, - {"focus", NULL, Tk_FocusObjCmd, 1, 1}, - {"font", NULL, Tk_FontObjCmd, 1, 1}, - {"grab", NULL, Tk_GrabObjCmd, 0, 1}, - {"grid", NULL, Tk_GridObjCmd, 1, 1}, - {"image", NULL, Tk_ImageObjCmd, 1, 1}, - {"lower", NULL, Tk_LowerObjCmd, 1, 1}, - {"option", NULL, Tk_OptionObjCmd, 1, 1}, - {"pack", NULL, Tk_PackObjCmd, 1, 1}, - {"place", NULL, Tk_PlaceObjCmd, 1, 0}, - {"raise", NULL, Tk_RaiseObjCmd, 1, 1}, - {"selection", NULL, Tk_SelectionObjCmd, 0, 1}, - {"tk", NULL, Tk_TkObjCmd, 1, 1}, - {"tkwait", NULL, Tk_TkwaitObjCmd, 1, 1}, + {"bell", NULL, Tk_BellObjCmd, PASSMAINWINDOW}, + {"bind", NULL, Tk_BindObjCmd, PASSMAINWINDOW|ISSAFE}, + {"bindtags", NULL, Tk_BindtagsObjCmd, PASSMAINWINDOW|ISSAFE}, + {"clipboard", NULL, Tk_ClipboardObjCmd, PASSMAINWINDOW}, + {"destroy", NULL, Tk_DestroyObjCmd, PASSMAINWINDOW|ISSAFE}, + {"event", NULL, Tk_EventObjCmd, PASSMAINWINDOW|ISSAFE}, + {"focus", NULL, Tk_FocusObjCmd, PASSMAINWINDOW|ISSAFE}, + {"font", NULL, Tk_FontObjCmd, PASSMAINWINDOW|ISSAFE}, + {"grab", NULL, Tk_GrabObjCmd, PASSMAINWINDOW}, + {"grid", NULL, Tk_GridObjCmd, PASSMAINWINDOW|ISSAFE}, + {"image", NULL, Tk_ImageObjCmd, PASSMAINWINDOW|ISSAFE}, + {"lower", NULL, Tk_LowerObjCmd, PASSMAINWINDOW|ISSAFE}, + {"option", NULL, Tk_OptionObjCmd, PASSMAINWINDOW|ISSAFE}, + {"pack", NULL, Tk_PackObjCmd, PASSMAINWINDOW|ISSAFE}, + {"place", NULL, Tk_PlaceObjCmd, ISSAFE}, + {"raise", NULL, Tk_RaiseObjCmd, PASSMAINWINDOW|ISSAFE}, + {"selection", NULL, Tk_SelectionObjCmd, PASSMAINWINDOW}, + {"tk", NULL, Tk_TkObjCmd, PASSMAINWINDOW|ISSAFE}, + {"tkwait", NULL, Tk_TkwaitObjCmd, PASSMAINWINDOW|ISSAFE}, #if defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK) - {"tk_chooseColor", NULL, Tk_ChooseColorObjCmd, 0, 1}, - {"tk_chooseDirectory", NULL, Tk_ChooseDirectoryObjCmd, 0, 1}, - {"tk_getOpenFile", NULL, Tk_GetOpenFileObjCmd, 0, 1}, - {"tk_getSaveFile", NULL, Tk_GetSaveFileObjCmd, 0, 1}, + {"tk_chooseColor", NULL, Tk_ChooseColorObjCmd, PASSMAINWINDOW}, + {"tk_chooseDirectory", NULL, Tk_ChooseDirectoryObjCmd, PASSMAINWINDOW}, + {"tk_getOpenFile", NULL, Tk_GetOpenFileObjCmd, PASSMAINWINDOW}, + {"tk_getSaveFile", NULL, Tk_GetSaveFileObjCmd, PASSMAINWINDOW}, #endif #if defined(__WIN32__) || defined(MAC_OSX_TK) - {"tk_messageBox", NULL, Tk_MessageBoxObjCmd, 0, 1}, + {"tk_messageBox", NULL, Tk_MessageBoxObjCmd, PASSMAINWINDOW}, #endif - {"update", NULL, Tk_UpdateObjCmd, 1, 1}, - {"winfo", NULL, Tk_WinfoObjCmd, 1, 1}, - {"wm", NULL, Tk_WmObjCmd, 0, 1}, + {"update", NULL, Tk_UpdateObjCmd, PASSMAINWINDOW|ISSAFE}, + {"winfo", NULL, Tk_WinfoObjCmd, PASSMAINWINDOW|ISSAFE}, + {"wm", NULL, Tk_WmObjCmd, PASSMAINWINDOW}, /* * Widget class commands. */ - {"button", NULL, Tk_ButtonObjCmd, 1, 0}, - {"canvas", NULL, Tk_CanvasObjCmd, 1, 1}, - {"checkbutton", NULL, Tk_CheckbuttonObjCmd, 1, 0}, - {"entry", NULL, Tk_EntryObjCmd, 1, 0}, - {"frame", NULL, Tk_FrameObjCmd, 1, 0}, - {"label", NULL, Tk_LabelObjCmd, 1, 0}, - {"labelframe", NULL, Tk_LabelframeObjCmd, 1, 0}, - {"listbox", NULL, Tk_ListboxObjCmd, 1, 0}, - {"menubutton", NULL, Tk_MenubuttonObjCmd, 1, 0}, - {"message", NULL, Tk_MessageObjCmd, 1, 0}, - {"panedwindow", NULL, Tk_PanedWindowObjCmd, 1, 0}, - {"radiobutton", NULL, Tk_RadiobuttonObjCmd, 1, 0}, - {"scale", NULL, Tk_ScaleObjCmd, 1, 0}, - {"scrollbar", Tk_ScrollbarCmd, NULL, 1, 1}, - {"spinbox", NULL, Tk_SpinboxObjCmd, 1, 0}, - {"text", Tk_TextCmd, NULL, 1, 1}, - {"toplevel", NULL, Tk_ToplevelObjCmd, 0, 0}, + {"button", NULL, Tk_ButtonObjCmd, ISSAFE}, + {"canvas", NULL, Tk_CanvasObjCmd, PASSMAINWINDOW|ISSAFE}, + {"checkbutton", NULL, Tk_CheckbuttonObjCmd, ISSAFE}, + {"entry", NULL, Tk_EntryObjCmd, ISSAFE}, + {"frame", NULL, Tk_FrameObjCmd, ISSAFE}, + {"label", NULL, Tk_LabelObjCmd, ISSAFE}, + {"labelframe", NULL, Tk_LabelframeObjCmd, ISSAFE}, + {"listbox", NULL, Tk_ListboxObjCmd, ISSAFE}, + {"menubutton", NULL, Tk_MenubuttonObjCmd, ISSAFE}, + {"message", NULL, Tk_MessageObjCmd, ISSAFE}, + {"panedwindow", NULL, Tk_PanedWindowObjCmd, ISSAFE}, + {"radiobutton", NULL, Tk_RadiobuttonObjCmd, ISSAFE}, + {"scale", NULL, Tk_ScaleObjCmd, ISSAFE}, + {"scrollbar", Tk_ScrollbarCmd, NULL, PASSMAINWINDOW|ISSAFE}, + {"spinbox", NULL, Tk_SpinboxObjCmd, ISSAFE}, + {"text", Tk_TextCmd, NULL, PASSMAINWINDOW|ISSAFE}, + {"toplevel", NULL, Tk_ToplevelObjCmd, 0}, /* * Misc. @@ -177,7 +174,7 @@ static TkCmd commands[] = { #if defined(MAC_TCL) || defined(MAC_OSX_TK) {"::tk::unsupported::MacWindowStyle", - NULL, TkUnsupported1ObjCmd, 1, 1}, + NULL, TkUnsupported1ObjCmd, PASSMAINWINDOW|ISSAFE}, #endif {(char *) NULL, (int (*) _ANSI_ARGS_((ClientData, Tcl_Interp *, int, CONST char **))) NULL, NULL, 0} }; @@ -857,7 +854,7 @@ TkCreateMainWindow(interp, screenName, baseName) Tcl_HashEntry *hPtr; register TkMainInfo *mainPtr; register TkWindow *winPtr; - register TkCmd *cmdPtr; + register CONST TkCmd *cmdPtr; ClientData clientData; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); @@ -942,9 +939,9 @@ TkCreateMainWindow(interp, screenName, baseName) isSafe = Tcl_IsSafe(interp); for (cmdPtr = commands; cmdPtr->name != NULL; cmdPtr++) { if ((cmdPtr->cmdProc == NULL) && (cmdPtr->objProc == NULL)) { - panic("TkCreateMainWindow: builtin command with NULL string and object procs"); + Tcl_Panic("TkCreateMainWindow: builtin command with NULL string and object procs"); } - if (cmdPtr->passMainWindow) { + if (cmdPtr->flags & PASSMAINWINDOW) { clientData = (ClientData) tkwin; } else { clientData = (ClientData) NULL; @@ -956,11 +953,11 @@ TkCreateMainWindow(interp, screenName, baseName) Tcl_CreateObjCommand(interp, cmdPtr->name, cmdPtr->objProc, clientData, NULL); } - if (isSafe) { - if (!(cmdPtr->isSafe)) { - Tcl_HideCommand(interp, cmdPtr->name, cmdPtr->name); - } - } + if (isSafe) { + if (!(cmdPtr->flags & ISSAFE)) { + Tcl_HideCommand(interp, cmdPtr->name, cmdPtr->name); + } + } } TkCreateMenuCmd(interp); @@ -1514,7 +1511,7 @@ Tk_DestroyWindow(tkwin) } winPtr->mainPtr->refCount--; if (winPtr->mainPtr->refCount == 0) { - register TkCmd *cmdPtr; + register CONST TkCmd *cmdPtr; /* * We just deleted the last window in the application. Delete diff --git a/unix/Makefile.in b/unix/Makefile.in index 27bbb19..b43c1ef 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -632,8 +632,15 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish (\ relative=`echo | awk '{ORS=" "; split("$(TK_PKG_DIR)",a,"/"); for (f in a) {print ".."}}'`;\ echo "if {[package vcompare [package provide Tcl] $(TCLVERSION)] != 0} { return }";\ - echo "package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)\ - [list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\ + echo "if {[string match CYGWIN* \$$::tcl_platform(os)]} {";\ + echo " if {([info exists ::env(DISPLAY)] || [lsearch -exact \$$::argv -display] > -1)} {";\ + echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}.. bin $(TK_LIB_FILE)] Tk]";\ + echo " } else {";\ + echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}.. bin tk${MAJOR_VERSION}${MINOR_VERSION}.dll] Tk]";\ + echo " }";\ + echo "} else {";\ + echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\ + echo "}";\ ) > $(PKG_INDEX); \ fi @echo "Installing $(LIB_FILE) to $(LIB_INSTALL_DIR)/" -- cgit v0.12 From 8a1bd75ea0b55649f8dbabaa86aae60fc85b116b Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 18 Apr 2012 12:30:49 +0000 Subject: compiler warnings --- generic/tkWindow.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/tkWindow.c b/generic/tkWindow.c index df1bf86..5b11f64 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -151,7 +151,7 @@ static const TkCmd commands[] = { {"scrollbar", Tk_ScrollbarCmd, NULL, PASSMAINWINDOW|ISSAFE}, {"spinbox", NULL, Tk_SpinboxObjCmd, ISSAFE}, {"text", NULL, Tk_TextObjCmd, PASSMAINWINDOW|ISSAFE}, - {"toplevel", NULL, Tk_ToplevelObjCmd, 0, 0}, + {"toplevel", NULL, Tk_ToplevelObjCmd, 0}, /* * Classic widget class commands. @@ -860,7 +860,7 @@ TkCreateMainWindow( Tcl_HashEntry *hPtr; register TkMainInfo *mainPtr; register TkWindow *winPtr; - register TkCmd *cmdPtr; + register const TkCmd *cmdPtr; ClientData clientData; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); @@ -1502,7 +1502,7 @@ Tk_DestroyWindow( } winPtr->mainPtr->refCount--; if (winPtr->mainPtr->refCount == 0) { - register TkCmd *cmdPtr; + register const TkCmd *cmdPtr; /* * We just deleted the last window in the application. Delete the -- cgit v0.12 From 95c5b39b2e335c0fc08a25281ad9097a29aee1ae Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 18 Apr 2012 18:08:37 +0000 Subject: make some more internal tables CONST --- generic/tkArgv.c | 2 +- generic/tkAtom.c | 4 ++-- generic/tkButton.c | 8 ++++---- generic/tkEntry.c | 4 ++-- generic/tkFrame.c | 6 +++--- generic/tkImgBmap.c | 2 +- generic/tkListbox.c | 4 ++-- generic/tkMenubutton.c | 6 +++--- generic/tkPanedWindow.c | 2 +- generic/tkPlace.c | 2 +- generic/tkScale.c | 4 ++-- generic/tkTest.c | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/generic/tkArgv.c b/generic/tkArgv.c index 4821f41..4ee3b78 100644 --- a/generic/tkArgv.c +++ b/generic/tkArgv.c @@ -355,7 +355,7 @@ PrintUsage(interp, argTable, flags) register Tk_ArgvInfo *infoPtr; int width, i, numSpaces; #define NUM_SPACES 20 - static char spaces[] = " "; + static CONST char spaces[] = " "; char tmp[TCL_DOUBLE_SPACE]; /* diff --git a/generic/tkAtom.c b/generic/tkAtom.c index f94af81..108e989 100644 --- a/generic/tkAtom.c +++ b/generic/tkAtom.c @@ -22,7 +22,7 @@ * They should match those found in xatom.h */ -static char * atomNameArray[] = { +static CONST char *atomNameArray[] = { "PRIMARY", "SECONDARY", "ARC", "ATOM", "BITMAP", "CARDINAL", "COLORMAP", "CURSOR", "CUT_BUFFER0", @@ -199,7 +199,7 @@ AtomInit(dispPtr) for (atom = 1; atom <= XA_LAST_PREDEFINED; atom++) { hPtr = Tcl_FindHashEntry(&dispPtr->atomTable, (char *) atom); if (hPtr == NULL) { - char *name; + CONST char *name; int new; name = atomNameArray[atom - 1]; diff --git a/generic/tkButton.c b/generic/tkButton.c index 3783985..e844cec 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.c @@ -25,14 +25,14 @@ static Tcl_ThreadDataKey dataKey; * in tkButton.h. */ -static char *classNames[] = {"Label", "Button", "Checkbutton", "Radiobutton"}; +static CONST char *classNames[] = {"Label", "Button", "Checkbutton", "Radiobutton"}; /* * The following table defines the legal values for the -default option. * It is used together with the "enum defaultValue" declaration in tkButton.h. */ -static char *defaultStrings[] = { +static CONST char *defaultStrings[] = { "active", "disabled", "normal", (char *) NULL }; @@ -41,7 +41,7 @@ static char *defaultStrings[] = { * It is used together with the "enum state" declaration in tkButton.h. */ -static char *stateStrings[] = { +static CONST char *stateStrings[] = { "active", "disabled", "normal", (char *) NULL }; @@ -50,7 +50,7 @@ static char *stateStrings[] = { * It is used with the "enum compound" declaration in tkButton.h */ -static char *compoundStrings[] = { +static CONST char *compoundStrings[] = { "bottom", "center", "left", "none", "right", "top", (char *) NULL }; diff --git a/generic/tkEntry.c b/generic/tkEntry.c index afd6b15..c6eed1b 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -35,7 +35,7 @@ #define DOUBLES_EQ(d1, d2) (fabs((d1) - (d2)) < MIN_DBL_VAL) -static char *stateStrings[] = { +static CONST char *stateStrings[] = { "disabled", "normal", "readonly", (char *) NULL }; @@ -43,7 +43,7 @@ static char *stateStrings[] = { * Definitions for -validate option values: */ -static char *validateStrings[] = { +static CONST char *validateStrings[] = { "all", "key", "focus", "focusin", "focusout", "none", (char *) NULL }; enum validateType { diff --git a/generic/tkFrame.c b/generic/tkFrame.c index 453ad73..a416b22 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.c @@ -170,7 +170,7 @@ enum labelanchor { LABELANCHOR_W, LABELANCHOR_WN, LABELANCHOR_WS }; -static char *labelAnchorStrings[] = { +static CONST char *labelAnchorStrings[] = { "e", "en", "es", "n", "ne", "nw", "s", "se", "sw", "w", "wn", "ws", (char *) NULL }; @@ -302,7 +302,7 @@ static Tk_OptionSpec labelframeOptSpec[] = { * Class names for widgets, indexed by FrameType. */ -static char *classNames[] = {"Frame", "Toplevel", "Labelframe"}; +static CONST char *classNames[] = {"Frame", "Toplevel", "Labelframe"}; /* * The following table maps from FrameType to the option template for @@ -312,7 +312,7 @@ static char *classNames[] = {"Frame", "Toplevel", "Labelframe"}; static Tk_OptionSpec *optionSpecs[] = { frameOptSpec, toplevelOptSpec, - labelframeOptSpec, + labelframeOptSpec }; /* diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c index e1ccecb..2542697 100644 --- a/generic/tkImgBmap.c +++ b/generic/tkImgBmap.c @@ -1159,7 +1159,7 @@ ImgBmapPsImagemask(interp, width, height, data) * on the left.) The following array is used to reverse the order of bits * within a byte so that the bits will be in the order postscript expects. */ - static unsigned char bit_reverse[] = { + static CONST unsigned char bit_reverse[] = { 0, 128, 64, 192, 32, 160, 96, 224, 16, 144, 80, 208, 48, 176, 112, 240, 8, 136, 72, 200, 40, 168, 104, 232, 24, 152, 88, 216, 56, 184, 120, 248, 4, 132, 68, 196, 36, 164, 100, 228, 20, 148, 84, 212, 52, 180, 116, 244, diff --git a/generic/tkListbox.c b/generic/tkListbox.c index cc73937..6f8156f 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -210,7 +210,7 @@ enum state { STATE_DISABLED, STATE_NORMAL }; -static char *stateStrings[] = { +static CONST char *stateStrings[] = { "disabled", "normal", (char *) NULL }; @@ -218,7 +218,7 @@ enum activeStyle { ACTIVE_STYLE_DOTBOX, ACTIVE_STYLE_NONE, ACTIVE_STYLE_UNDERLINE }; -static char *activeStyleStrings[] = { +static CONST char *activeStyleStrings[] = { "dotbox", "none", "underline", (char *) NULL }; diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c index 8292b32..7e9a11a 100644 --- a/generic/tkMenubutton.c +++ b/generic/tkMenubutton.c @@ -21,7 +21,7 @@ * in tkMenubutton.h. */ -static char *directionStrings[] = { +static CONST char *directionStrings[] = { "above", "below", "flush", "left", "right", (char *) NULL }; @@ -30,7 +30,7 @@ static char *directionStrings[] = { * It is used together with the "enum state" declaration in tkMenubutton.h. */ -static char *stateStrings[] = { +static CONST char *stateStrings[] = { "active", "disabled", "normal", (char *) NULL }; @@ -39,7 +39,7 @@ static char *stateStrings[] = { * It is used with the "enum compound" declaration in tkMenuButton.h */ -static char *compoundStrings[] = { +static CONST char *compoundStrings[] = { "bottom", "center", "left", "none", "right", "top", (char *) NULL }; diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 57670ba..09106dd 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -34,7 +34,7 @@ * The following table defines the legal values for the -orient option. */ -static char *orientStrings[] = { +static CONST char *orientStrings[] = { "horizontal", "vertical", (char *) NULL }; diff --git a/generic/tkPlace.c b/generic/tkPlace.c index b239947..6178d26 100644 --- a/generic/tkPlace.c +++ b/generic/tkPlace.c @@ -26,7 +26,7 @@ * master's actual window size. */ -static char *borderModeStrings[] = { +static CONST char *borderModeStrings[] = { "inside", "outside", "ignore", (char *) NULL }; diff --git a/generic/tkScale.c b/generic/tkScale.c index 676f84b..9b582fe 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -30,7 +30,7 @@ * It is used together with the "enum orient" declaration in tkScale.h. */ -static char *orientStrings[] = { +static CONST char *orientStrings[] = { "horizontal", "vertical", (char *) NULL }; @@ -39,7 +39,7 @@ static char *orientStrings[] = { * It is used together with the "enum state" declaration in tkScale.h. */ -static char *stateStrings[] = { +static CONST char *stateStrings[] = { "active", "disabled", "normal", (char *) NULL }; diff --git a/generic/tkTest.c b/generic/tkTest.c index 0d6657a..fdd70b7 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -717,7 +717,7 @@ TestobjconfigObjCmd(clientData, interp, objc, objv) Tcl_Obj *customPtr; } TypesRecord; TypesRecord *recordPtr; - static char *stringTable[] = {"one", "two", "three", "four", + static CONST char *stringTable[] = {"one", "two", "three", "four", (char *) NULL}; static Tk_OptionSpec typesSpecs[] = { {TK_OPTION_BOOLEAN, @@ -1032,7 +1032,7 @@ TestobjconfigObjCmd(clientData, interp, objc, objv) char *custom; } InternalRecord; InternalRecord *recordPtr; - static char *internalStringTable[] = { + static CONST char *internalStringTable[] = { "one", "two", "three", "four", (char *) NULL }; static Tk_OptionSpec internalSpecs[] = { -- cgit v0.12 From fd636b80ebd519e891807305cf5c22f69a03edd6 Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 20 Apr 2012 13:08:25 +0000 Subject: * generic/tkWindow.c (commands): Ensure that all descriptions of commands created by Tk are correct. --- ChangeLog | 22 +++++++++++++--------- generic/tkWindow.c | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0961552..e5b5ff3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,23 +1,27 @@ +2012-04-20 Donal K. Fellows + + * generic/tkWindow.c (commands): Ensure that all descriptions of + commands created by Tk are correct. + 2012-04-20 Jan Nijtmans - * generic/tk.tcl: Use vroot size in stead of screen size for - clipping window coordinates in ::tk::PlaceWindow. - * generic/dialog.tcl: Use ::tk::PlaceWindow in dialog.tcl, in - stead of dumplicating the code there. - (harmless part of [Bug 533519]) + * generic/tk.tcl: Use vroot size in stead of screen size for clipping + window coordinates in ::tk::PlaceWindow. + * generic/dialog.tcl: Use ::tk::PlaceWindow in dialog.tcl, instead of + dumplicating the code there. (harmless part of [Bug 533519]) 2012-04-13 Jan Nijtmans - * win/rules.vc: [Bug 3517448] TclKit build fails (unresolved + * win/rules.vc: [Bug 3517448]: TclKit build fails (unresolved __strtoi64) 2012-04-07 Jan Nijtmans - * generic/tkBind.c: [Bug 3176239] control-MouseWheel causes segv + * generic/tkBind.c: [Bug 3176239]: control-MouseWheel causes segv 2012-03-30 Jan Nijtmans - * unix/tcl.m4: [Bug 3511806] Compiler checks too early + * unix/tcl.m4: [Bug 3511806]: Compiler checks too early * unix/configure.in: This change allows to build the cygwin * unix/configure and mingw32 ports of Tcl/Tk to build * win/tcl.m4: out-of-the-box using a native or cross- @@ -26,7 +30,7 @@ 2012-03-21 Jan Nijtmans - * generic/tkColor.c: [Bug 2809525] Abort on overlong color name. + * generic/tkColor.c: [Bug 2809525]: Abort on overlong color name. * unix/tkUnixColor.c: 2012-03-18 Jan Nijtmans diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 250898c..40cf462 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -184,7 +184,7 @@ static const TkCmd commands[] = { #if defined(__WIN32__) || defined(MAC_OSX_TK) {"tk_chooseColor", NULL, Tk_ChooseColorObjCmd, NULL, PASSMAINWINDOW}, - {"tk_chooseDirectory", NULL, Tk_ChooseDirectoryObjCmd,NULL, 0, 1}, + {"tk_chooseDirectory", NULL, Tk_ChooseDirectoryObjCmd,NULL,PASSMAINWINDOW}, {"tk_getOpenFile", NULL, Tk_GetOpenFileObjCmd, NULL, PASSMAINWINDOW}, {"tk_getSaveFile", NULL, Tk_GetSaveFileObjCmd, NULL, PASSMAINWINDOW}, {"tk_messageBox", NULL, Tk_MessageBoxObjCmd, NULL, PASSMAINWINDOW}, -- cgit v0.12 From 1ad8b81988aa95d3ae080faa924677e7c9d56c1f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 20 Apr 2012 13:20:37 +0000 Subject: unused variable --- generic/tkMenuDraw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkMenuDraw.c b/generic/tkMenuDraw.c index 6f0499a..7c69548 100644 --- a/generic/tkMenuDraw.c +++ b/generic/tkMenuDraw.c @@ -857,7 +857,7 @@ TkPostTearoffMenu(interp, menuPtr, x, y) * are posting */ { int vRootX, vRootY, vRootWidth, vRootHeight; - int tmp, result; + int result; TkActivateMenuEntry(menuPtr, -1); TkRecomputeMenu(menuPtr); -- cgit v0.12 From a0029792b685e19df1d79a8170579d88416055b0 Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 22 Apr 2012 22:03:10 +0000 Subject: [Bug 3520202]: %K must not work with or effects are undefined! --- ChangeLog | 9 +++++++++ generic/tkBind.c | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) mode change 100755 => 100644 generic/tkBind.c diff --git a/ChangeLog b/ChangeLog index 37db952..561a56c 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-04-22 Donal K. Fellows + + * generic/tkBind.c (ExpandPercents): [Bug 3520202]: Ensure that the + %k, %K and %N substitutions use dummy tokens with events + and that the %D subsitution is a dummy with /. This + was causing significant indigestion (and a read of goodness knows what + memory) to Tkinter/Python because of the way they map events between + languages. + 2012-04-20 Jan Nijtmans * generic/tk.tcl: Use vroot size in stead of screen size for diff --git a/generic/tkBind.c b/generic/tkBind.c old mode 100755 new mode 100644 index 3f05ccc..7e8d823 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -2428,7 +2428,7 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr) string = numStorage; goto doString; case 'k': - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) { number = eventPtr->xkey.keycode; goto doNumber; } @@ -2567,7 +2567,7 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr) /* * This is used only by the MouseWheel event. */ - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type == MouseWheelEvent)) { number = eventPtr->xkey.keycode; goto doNumber; } @@ -2576,7 +2576,7 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr) number = (int) eventPtr->xany.send_event; goto doNumber; case 'K': - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) { char *name; name = TkKeysymToString(keySym); @@ -2586,7 +2586,7 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr) } goto doString; case 'N': - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) { number = (int) keySym; goto doNumber; } -- cgit v0.12 From 75d0d5da127d9d9b7fbc4b5989c6510eb950e402 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 25 Apr 2012 13:30:03 +0000 Subject: implement various internal win32 stub functions for cygwin --- doc/GetHWND.3 | 2 +- generic/tk.decls | 23 +++- generic/tkInt.decls | 22 ++-- generic/tkIntDecls.h | 294 -------------------------------------------- generic/tkPlatDecls.h | 52 ++++++++ generic/tkStubInit.c | 145 ++++++++-------------- generic/tkWindow.c | 25 +++- unix/Makefile.in | 5 +- unix/configure | 333 ++++++++++++++++++++++++++------------------------ unix/tcl.m4 | 21 +++- 10 files changed, 348 insertions(+), 574 deletions(-) diff --git a/doc/GetHWND.3 b/doc/GetHWND.3 index 70fb0dd..06bdf37 100644 --- a/doc/GetHWND.3 +++ b/doc/GetHWND.3 @@ -6,7 +6,7 @@ .TH HWND 3 8.0 Tk "Tk Library Procedures" .BS .SH NAME -Tk_GetHWND, Tk_AttachHWND \- manage interactione between the Windows handle and an X window +Tk_GetHWND, Tk_AttachHWND \- manage interactions between the Windows handle and an X window .SH SYNOPSIS .nf \fB#include \fR diff --git a/generic/tk.decls b/generic/tk.decls index c024cdb..2fae0b8 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -1026,7 +1026,28 @@ interface tkPlat ################################ # Unix specific functions -# (none) +# + +declare 0 unix { + Window Tk_AttachHWND(Tk_Window tkwin, void *hwnd) +} +declare 1 unix { + void *Tk_GetHINSTANCE(void) +} +declare 2 unix { + void *Tk_GetHWND(Window window) +} +declare 3 unix { + Tk_Window Tk_HWNDToWindow(void *hwnd) +} +declare 4 unix { + void Tk_PointerEvent(void *hwnd, int x, int y) +} +declare 5 unix { + int Tk_TranslateWinEvent(void *hwnd, + unsigned int message, int wParam, int lParam, int *result) +} + ################################ # Windows specific functions diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 68b8788..3453f88 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -403,26 +403,26 @@ declare 111 { declare 112 { void TkpMenuThreadInit(void) } -declare 113 {mac aqua win} { +declare 113 { void TkClipBox(TkRegion rgn, XRectangle *rect_return) } -declare 114 {mac aqua win} { +declare 114 { TkRegion TkCreateRegion(void) } -declare 115 {mac aqua win} { +declare 115 { void TkDestroyRegion(TkRegion rgn) } -declare 116 {mac aqua win} { +declare 116 { void TkIntersectRegion(TkRegion sra, TkRegion srcb, TkRegion dr_return) } -declare 117 {mac aqua win} { +declare 117 { int TkRectInRegion(TkRegion rgn, int x, int y, unsigned int width, unsigned int height) } -declare 118 {mac aqua win} { +declare 118 { void TkSetRegion(Display *display, GC gc, TkRegion rgn) } -declare 119 {mac aqua win} { +declare 119 { void TkUnionRectWithRegion(XRectangle *rect, TkRegion src, TkRegion dr_return) } @@ -468,7 +468,7 @@ declare 143 { declare 144 { void TkGCCleanup(TkDisplay *dispPtr) } -declare 145 {mac win aqua} { +declare 145 { void TkSubtractRegion(TkRegion sra, TkRegion srcb, TkRegion dr_return) } declare 146 { @@ -655,6 +655,9 @@ declare 33 win { declare 34 win { void TkWinSetHINSTANCE(HINSTANCE hInstance) } +declare 35 win { + int TkWinGetPlatformTheme(void) +} ################################ # Mac specific functions @@ -836,9 +839,6 @@ declare 65 mac { declare 66 mac { int TkpIsWindowFloating(WindowRef window) } -declare 35 win { - int TkWinGetPlatformTheme(void) -} ################################ # Aqua specific functions diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index 3654621..23dcda4 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -362,108 +362,26 @@ EXTERN Tcl_Obj * TkpGetSystemDefault _ANSI_ARGS_((Tk_Window tkwin, CONST char *dbName, CONST char *className)); /* 112 */ EXTERN void TkpMenuThreadInit _ANSI_ARGS_((void)); -#ifdef __WIN32__ -/* 113 */ -EXTERN void TkClipBox _ANSI_ARGS_((TkRegion rgn, - XRectangle *rect_return)); -#endif /* __WIN32__ */ -#ifdef MAC_TCL -/* 113 */ -EXTERN void TkClipBox _ANSI_ARGS_((TkRegion rgn, - XRectangle *rect_return)); -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK /* 113 */ EXTERN void TkClipBox _ANSI_ARGS_((TkRegion rgn, XRectangle *rect_return)); -#endif /* MAC_OSX_TK */ -#ifdef __WIN32__ -/* 114 */ -EXTERN TkRegion TkCreateRegion _ANSI_ARGS_((void)); -#endif /* __WIN32__ */ -#ifdef MAC_TCL -/* 114 */ -EXTERN TkRegion TkCreateRegion _ANSI_ARGS_((void)); -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK /* 114 */ EXTERN TkRegion TkCreateRegion _ANSI_ARGS_((void)); -#endif /* MAC_OSX_TK */ -#ifdef __WIN32__ -/* 115 */ -EXTERN void TkDestroyRegion _ANSI_ARGS_((TkRegion rgn)); -#endif /* __WIN32__ */ -#ifdef MAC_TCL /* 115 */ EXTERN void TkDestroyRegion _ANSI_ARGS_((TkRegion rgn)); -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK -/* 115 */ -EXTERN void TkDestroyRegion _ANSI_ARGS_((TkRegion rgn)); -#endif /* MAC_OSX_TK */ -#ifdef __WIN32__ -/* 116 */ -EXTERN void TkIntersectRegion _ANSI_ARGS_((TkRegion sra, - TkRegion srcb, TkRegion dr_return)); -#endif /* __WIN32__ */ -#ifdef MAC_TCL /* 116 */ EXTERN void TkIntersectRegion _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK -/* 116 */ -EXTERN void TkIntersectRegion _ANSI_ARGS_((TkRegion sra, - TkRegion srcb, TkRegion dr_return)); -#endif /* MAC_OSX_TK */ -#ifdef __WIN32__ -/* 117 */ -EXTERN int TkRectInRegion _ANSI_ARGS_((TkRegion rgn, int x, - int y, unsigned int width, - unsigned int height)); -#endif /* __WIN32__ */ -#ifdef MAC_TCL -/* 117 */ -EXTERN int TkRectInRegion _ANSI_ARGS_((TkRegion rgn, int x, - int y, unsigned int width, - unsigned int height)); -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK /* 117 */ EXTERN int TkRectInRegion _ANSI_ARGS_((TkRegion rgn, int x, int y, unsigned int width, unsigned int height)); -#endif /* MAC_OSX_TK */ -#ifdef __WIN32__ -/* 118 */ -EXTERN void TkSetRegion _ANSI_ARGS_((Display *display, GC gc, - TkRegion rgn)); -#endif /* __WIN32__ */ -#ifdef MAC_TCL /* 118 */ EXTERN void TkSetRegion _ANSI_ARGS_((Display *display, GC gc, TkRegion rgn)); -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK -/* 118 */ -EXTERN void TkSetRegion _ANSI_ARGS_((Display *display, GC gc, - TkRegion rgn)); -#endif /* MAC_OSX_TK */ -#ifdef __WIN32__ /* 119 */ EXTERN void TkUnionRectWithRegion _ANSI_ARGS_((XRectangle *rect, TkRegion src, TkRegion dr_return)); -#endif /* __WIN32__ */ -#ifdef MAC_TCL -/* 119 */ -EXTERN void TkUnionRectWithRegion _ANSI_ARGS_((XRectangle *rect, - TkRegion src, TkRegion dr_return)); -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK -/* 119 */ -EXTERN void TkUnionRectWithRegion _ANSI_ARGS_((XRectangle *rect, - TkRegion src, TkRegion dr_return)); -#endif /* MAC_OSX_TK */ /* Slot 120 is reserved */ #ifdef MAC_TCL /* 121 */ @@ -531,21 +449,9 @@ EXTERN void TkFocusFree _ANSI_ARGS_((TkMainInfo *mainPtr)); EXTERN void TkClipCleanup _ANSI_ARGS_((TkDisplay *dispPtr)); /* 144 */ EXTERN void TkGCCleanup _ANSI_ARGS_((TkDisplay *dispPtr)); -#ifdef __WIN32__ -/* 145 */ -EXTERN void TkSubtractRegion _ANSI_ARGS_((TkRegion sra, - TkRegion srcb, TkRegion dr_return)); -#endif /* __WIN32__ */ -#ifdef MAC_TCL -/* 145 */ -EXTERN void TkSubtractRegion _ANSI_ARGS_((TkRegion sra, - TkRegion srcb, TkRegion dr_return)); -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK /* 145 */ EXTERN void TkSubtractRegion _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); -#endif /* MAC_OSX_TK */ /* 146 */ EXTERN void TkStylePkgInit _ANSI_ARGS_((TkMainInfo *mainPtr)); /* 147 */ @@ -680,90 +586,13 @@ typedef struct TkIntStubs { void (*tkpGetSubFonts) _ANSI_ARGS_((Tcl_Interp *interp, Tk_Font tkfont)); /* 110 */ Tcl_Obj * (*tkpGetSystemDefault) _ANSI_ARGS_((Tk_Window tkwin, CONST char *dbName, CONST char *className)); /* 111 */ void (*tkpMenuThreadInit) _ANSI_ARGS_((void)); /* 112 */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - VOID *reserved113; -#endif /* UNIX */ -#ifdef __WIN32__ - void (*tkClipBox) _ANSI_ARGS_((TkRegion rgn, XRectangle *rect_return)); /* 113 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL void (*tkClipBox) _ANSI_ARGS_((TkRegion rgn, XRectangle *rect_return)); /* 113 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK - void (*tkClipBox) _ANSI_ARGS_((TkRegion rgn, XRectangle *rect_return)); /* 113 */ -#endif /* MAC_OSX_TK */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - VOID *reserved114; -#endif /* UNIX */ -#ifdef __WIN32__ TkRegion (*tkCreateRegion) _ANSI_ARGS_((void)); /* 114 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - TkRegion (*tkCreateRegion) _ANSI_ARGS_((void)); /* 114 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK - TkRegion (*tkCreateRegion) _ANSI_ARGS_((void)); /* 114 */ -#endif /* MAC_OSX_TK */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - VOID *reserved115; -#endif /* UNIX */ -#ifdef __WIN32__ void (*tkDestroyRegion) _ANSI_ARGS_((TkRegion rgn)); /* 115 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - void (*tkDestroyRegion) _ANSI_ARGS_((TkRegion rgn)); /* 115 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK - void (*tkDestroyRegion) _ANSI_ARGS_((TkRegion rgn)); /* 115 */ -#endif /* MAC_OSX_TK */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - VOID *reserved116; -#endif /* UNIX */ -#ifdef __WIN32__ void (*tkIntersectRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 116 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - void (*tkIntersectRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 116 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK - void (*tkIntersectRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 116 */ -#endif /* MAC_OSX_TK */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - VOID *reserved117; -#endif /* UNIX */ -#ifdef __WIN32__ - int (*tkRectInRegion) _ANSI_ARGS_((TkRegion rgn, int x, int y, unsigned int width, unsigned int height)); /* 117 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - int (*tkRectInRegion) _ANSI_ARGS_((TkRegion rgn, int x, int y, unsigned int width, unsigned int height)); /* 117 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK int (*tkRectInRegion) _ANSI_ARGS_((TkRegion rgn, int x, int y, unsigned int width, unsigned int height)); /* 117 */ -#endif /* MAC_OSX_TK */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - VOID *reserved118; -#endif /* UNIX */ -#ifdef __WIN32__ - void (*tkSetRegion) _ANSI_ARGS_((Display *display, GC gc, TkRegion rgn)); /* 118 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - void (*tkSetRegion) _ANSI_ARGS_((Display *display, GC gc, TkRegion rgn)); /* 118 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK void (*tkSetRegion) _ANSI_ARGS_((Display *display, GC gc, TkRegion rgn)); /* 118 */ -#endif /* MAC_OSX_TK */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - VOID *reserved119; -#endif /* UNIX */ -#ifdef __WIN32__ - void (*tkUnionRectWithRegion) _ANSI_ARGS_((XRectangle *rect, TkRegion src, TkRegion dr_return)); /* 119 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - void (*tkUnionRectWithRegion) _ANSI_ARGS_((XRectangle *rect, TkRegion src, TkRegion dr_return)); /* 119 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK void (*tkUnionRectWithRegion) _ANSI_ARGS_((XRectangle *rect, TkRegion src, TkRegion dr_return)); /* 119 */ -#endif /* MAC_OSX_TK */ VOID *reserved120; #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ VOID *reserved121; @@ -822,18 +651,7 @@ typedef struct TkIntStubs { void (*tkFocusFree) _ANSI_ARGS_((TkMainInfo *mainPtr)); /* 142 */ void (*tkClipCleanup) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 143 */ void (*tkGCCleanup) _ANSI_ARGS_((TkDisplay *dispPtr)); /* 144 */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - VOID *reserved145; -#endif /* UNIX */ -#ifdef __WIN32__ - void (*tkSubtractRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 145 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL void (*tkSubtractRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 145 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK - void (*tkSubtractRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 145 */ -#endif /* MAC_OSX_TK */ void (*tkStylePkgInit) _ANSI_ARGS_((TkMainInfo *mainPtr)); /* 146 */ void (*tkStylePkgFree) _ANSI_ARGS_((TkMainInfo *mainPtr)); /* 147 */ Tk_Window (*tkToplevelWindowForCommand) _ANSI_ARGS_((Tcl_Interp *interp, CONST char *cmdName)); /* 148 */ @@ -1306,132 +1124,34 @@ extern TkIntStubs *tkIntStubsPtr; #define TkpMenuThreadInit \ (tkIntStubsPtr->tkpMenuThreadInit) /* 112 */ #endif -#ifdef __WIN32__ -#ifndef TkClipBox -#define TkClipBox \ - (tkIntStubsPtr->tkClipBox) /* 113 */ -#endif -#endif /* __WIN32__ */ -#ifdef MAC_TCL #ifndef TkClipBox #define TkClipBox \ (tkIntStubsPtr->tkClipBox) /* 113 */ #endif -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK -#ifndef TkClipBox -#define TkClipBox \ - (tkIntStubsPtr->tkClipBox) /* 113 */ -#endif -#endif /* MAC_OSX_TK */ -#ifdef __WIN32__ -#ifndef TkCreateRegion -#define TkCreateRegion \ - (tkIntStubsPtr->tkCreateRegion) /* 114 */ -#endif -#endif /* __WIN32__ */ -#ifdef MAC_TCL -#ifndef TkCreateRegion -#define TkCreateRegion \ - (tkIntStubsPtr->tkCreateRegion) /* 114 */ -#endif -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK #ifndef TkCreateRegion #define TkCreateRegion \ (tkIntStubsPtr->tkCreateRegion) /* 114 */ #endif -#endif /* MAC_OSX_TK */ -#ifdef __WIN32__ -#ifndef TkDestroyRegion -#define TkDestroyRegion \ - (tkIntStubsPtr->tkDestroyRegion) /* 115 */ -#endif -#endif /* __WIN32__ */ -#ifdef MAC_TCL -#ifndef TkDestroyRegion -#define TkDestroyRegion \ - (tkIntStubsPtr->tkDestroyRegion) /* 115 */ -#endif -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK #ifndef TkDestroyRegion #define TkDestroyRegion \ (tkIntStubsPtr->tkDestroyRegion) /* 115 */ #endif -#endif /* MAC_OSX_TK */ -#ifdef __WIN32__ -#ifndef TkIntersectRegion -#define TkIntersectRegion \ - (tkIntStubsPtr->tkIntersectRegion) /* 116 */ -#endif -#endif /* __WIN32__ */ -#ifdef MAC_TCL -#ifndef TkIntersectRegion -#define TkIntersectRegion \ - (tkIntStubsPtr->tkIntersectRegion) /* 116 */ -#endif -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK #ifndef TkIntersectRegion #define TkIntersectRegion \ (tkIntStubsPtr->tkIntersectRegion) /* 116 */ #endif -#endif /* MAC_OSX_TK */ -#ifdef __WIN32__ -#ifndef TkRectInRegion -#define TkRectInRegion \ - (tkIntStubsPtr->tkRectInRegion) /* 117 */ -#endif -#endif /* __WIN32__ */ -#ifdef MAC_TCL -#ifndef TkRectInRegion -#define TkRectInRegion \ - (tkIntStubsPtr->tkRectInRegion) /* 117 */ -#endif -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK #ifndef TkRectInRegion #define TkRectInRegion \ (tkIntStubsPtr->tkRectInRegion) /* 117 */ #endif -#endif /* MAC_OSX_TK */ -#ifdef __WIN32__ -#ifndef TkSetRegion -#define TkSetRegion \ - (tkIntStubsPtr->tkSetRegion) /* 118 */ -#endif -#endif /* __WIN32__ */ -#ifdef MAC_TCL #ifndef TkSetRegion #define TkSetRegion \ (tkIntStubsPtr->tkSetRegion) /* 118 */ #endif -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK -#ifndef TkSetRegion -#define TkSetRegion \ - (tkIntStubsPtr->tkSetRegion) /* 118 */ -#endif -#endif /* MAC_OSX_TK */ -#ifdef __WIN32__ -#ifndef TkUnionRectWithRegion -#define TkUnionRectWithRegion \ - (tkIntStubsPtr->tkUnionRectWithRegion) /* 119 */ -#endif -#endif /* __WIN32__ */ -#ifdef MAC_TCL #ifndef TkUnionRectWithRegion #define TkUnionRectWithRegion \ (tkIntStubsPtr->tkUnionRectWithRegion) /* 119 */ #endif -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK -#ifndef TkUnionRectWithRegion -#define TkUnionRectWithRegion \ - (tkIntStubsPtr->tkUnionRectWithRegion) /* 119 */ -#endif -#endif /* MAC_OSX_TK */ /* Slot 120 is reserved */ #ifdef MAC_TCL #ifndef TkpCreateNativeBitmap @@ -1520,24 +1240,10 @@ extern TkIntStubs *tkIntStubsPtr; #define TkGCCleanup \ (tkIntStubsPtr->tkGCCleanup) /* 144 */ #endif -#ifdef __WIN32__ #ifndef TkSubtractRegion #define TkSubtractRegion \ (tkIntStubsPtr->tkSubtractRegion) /* 145 */ #endif -#endif /* __WIN32__ */ -#ifdef MAC_TCL -#ifndef TkSubtractRegion -#define TkSubtractRegion \ - (tkIntStubsPtr->tkSubtractRegion) /* 145 */ -#endif -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK -#ifndef TkSubtractRegion -#define TkSubtractRegion \ - (tkIntStubsPtr->tkSubtractRegion) /* 145 */ -#endif -#endif /* MAC_OSX_TK */ #ifndef TkStylePkgInit #define TkStylePkgInit \ (tkIntStubsPtr->tkStylePkgInit) /* 146 */ diff --git a/generic/tkPlatDecls.h b/generic/tkPlatDecls.h index ecc5919..f9bce86 100644 --- a/generic/tkPlatDecls.h +++ b/generic/tkPlatDecls.h @@ -29,6 +29,24 @@ * Exported function declarations: */ +#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ +/* 0 */ +EXTERN Window Tk_AttachHWND _ANSI_ARGS_((Tk_Window tkwin, + VOID *hwnd)); +/* 1 */ +EXTERN VOID * Tk_GetHINSTANCE _ANSI_ARGS_((void)); +/* 2 */ +EXTERN VOID * Tk_GetHWND _ANSI_ARGS_((Window window)); +/* 3 */ +EXTERN Tk_Window Tk_HWNDToWindow _ANSI_ARGS_((VOID *hwnd)); +/* 4 */ +EXTERN void Tk_PointerEvent _ANSI_ARGS_((VOID *hwnd, int x, + int y)); +/* 5 */ +EXTERN int Tk_TranslateWinEvent _ANSI_ARGS_((VOID *hwnd, + unsigned int message, int wParam, int lParam, + int *result)); +#endif /* UNIX */ #ifdef __WIN32__ /* 0 */ EXTERN Window Tk_AttachHWND _ANSI_ARGS_((Tk_Window tkwin, @@ -117,6 +135,14 @@ typedef struct TkPlatStubs { int magic; struct TkPlatStubHooks *hooks; +#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ + Window (*tk_AttachHWND) _ANSI_ARGS_((Tk_Window tkwin, VOID *hwnd)); /* 0 */ + VOID * (*tk_GetHINSTANCE) _ANSI_ARGS_((void)); /* 1 */ + VOID * (*tk_GetHWND) _ANSI_ARGS_((Window window)); /* 2 */ + Tk_Window (*tk_HWNDToWindow) _ANSI_ARGS_((VOID *hwnd)); /* 3 */ + void (*tk_PointerEvent) _ANSI_ARGS_((VOID *hwnd, int x, int y)); /* 4 */ + int (*tk_TranslateWinEvent) _ANSI_ARGS_((VOID *hwnd, unsigned int message, int wParam, int lParam, int *result)); /* 5 */ +#endif /* UNIX */ #ifdef __WIN32__ Window (*tk_AttachHWND) _ANSI_ARGS_((Tk_Window tkwin, HWND hwnd)); /* 0 */ HINSTANCE (*tk_GetHINSTANCE) _ANSI_ARGS_((void)); /* 1 */ @@ -167,6 +193,32 @@ extern TkPlatStubs *tkPlatStubsPtr; * Inline function declarations: */ +#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ +#ifndef Tk_AttachHWND +#define Tk_AttachHWND \ + (tkPlatStubsPtr->tk_AttachHWND) /* 0 */ +#endif +#ifndef Tk_GetHINSTANCE +#define Tk_GetHINSTANCE \ + (tkPlatStubsPtr->tk_GetHINSTANCE) /* 1 */ +#endif +#ifndef Tk_GetHWND +#define Tk_GetHWND \ + (tkPlatStubsPtr->tk_GetHWND) /* 2 */ +#endif +#ifndef Tk_HWNDToWindow +#define Tk_HWNDToWindow \ + (tkPlatStubsPtr->tk_HWNDToWindow) /* 3 */ +#endif +#ifndef Tk_PointerEvent +#define Tk_PointerEvent \ + (tkPlatStubsPtr->tk_PointerEvent) /* 4 */ +#endif +#ifndef Tk_TranslateWinEvent +#define Tk_TranslateWinEvent \ + (tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */ +#endif +#endif /* UNIX */ #ifdef __WIN32__ #ifndef Tk_AttachHWND #define Tk_AttachHWND \ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index a82e044..89ae433 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -40,18 +40,59 @@ /* * Remove macros that will interfere with the definitions below. */ +#undef TkClipBox +#undef TkCreateRegion +#undef TkDestroyRegion +#undef TkIntersectRegion +#undef TkRectInRegion +#undef TkSetRegion +#undef TkUnionRectWithRegion +#undef TkSubtractRegion -#define Tk_CreateCanvasVisitor ((void (*) _ANSI_ARGS_((Tcl_Interp * interp, \ - VOID * typePtr))) NULL) -#define Tk_GetCanvasVisitor ((VOID * (*) _ANSI_ARGS_((Tcl_Interp * interp, \ - CONST char * name))) NULL) +TkIntStubs tkIntStubs; #ifndef __WIN32__ /* Make sure that extensions which call XParseColor through * the stub table, call TkParseColor in stead. See bug #3486474 */ # define XParseColor TkParseColor + +# if !defined(MAC_TCL) && !defined(MAC_OSX_TCL) +# define Tk_AttachHWND 0 +# define Tk_GetHWND 0 +# define Tk_HWNDToWindow 0 +# define Tk_PointerEvent 0 +# define Tk_TranslateWinEvent 0 +# define TkClipBox (void (*) _ANSI_ARGS_((TkRegion, XRectangle *))) XClipBox +# define TkCreateRegion (TkRegion (*) ()) XCreateRegion +# define TkDestroyRegion (void (*) _ANSI_ARGS_((TkRegion))) XDestroyRegion +# define TkIntersectRegion (void (*) _ANSI_ARGS_((TkRegion, TkRegion, TkRegion))) XIntersectRegion +# define TkRectInRegion (int (*) _ANSI_ARGS_((TkRegion, int, int, unsigned int, unsigned int))) XRectInRegion +# define TkSetRegion (void (*) _ANSI_ARGS_((Display *, GC, TkRegion))) XSetRegion +# define TkUnionRectWithRegion (void (*) _ANSI_ARGS_((XRectangle *, TkRegion, TkRegion))) XUnionRectWithRegion +# define TkSubtractRegion (void (*) _ANSI_ARGS_((TkRegion, TkRegion, TkRegion))) XSubtractRegion + +#ifdef __CYGWIN__ +/* Trick, so we don't have to include here, which + * - b.t.w. - lacks this function anyway */ +#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004 +int __stdcall GetModuleHandleExW(unsigned int, const char *, void *); + +#define Tk_GetHINSTANCE TkPlatGetHINSTANCE +static void *Tk_GetHINSTANCE() +{ + void *hInstance = NULL; + GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, + (const char *)&tkIntStubs, &hInstance); + return hInstance; +} +#else +# define Tk_GetHINSTANCE 0 #endif +# endif /* !MAC_TCL && !MACC_OSX_TCL */ + +#endif /* !__WIN32__ */ + /* * WARNING: The contents of this file is automatically generated by the * tools/genStubs.tcl script. Any modifications to the function declarations @@ -176,90 +217,13 @@ TkIntStubs tkIntStubs = { TkpGetSubFonts, /* 110 */ TkpGetSystemDefault, /* 111 */ TkpMenuThreadInit, /* 112 */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - NULL, /* 113 */ -#endif /* UNIX */ -#ifdef __WIN32__ - TkClipBox, /* 113 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - TkClipBox, /* 113 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK TkClipBox, /* 113 */ -#endif /* MAC_OSX_TK */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - NULL, /* 114 */ -#endif /* UNIX */ -#ifdef __WIN32__ - TkCreateRegion, /* 114 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - TkCreateRegion, /* 114 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK TkCreateRegion, /* 114 */ -#endif /* MAC_OSX_TK */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - NULL, /* 115 */ -#endif /* UNIX */ -#ifdef __WIN32__ - TkDestroyRegion, /* 115 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - TkDestroyRegion, /* 115 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK TkDestroyRegion, /* 115 */ -#endif /* MAC_OSX_TK */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - NULL, /* 116 */ -#endif /* UNIX */ -#ifdef __WIN32__ - TkIntersectRegion, /* 116 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL TkIntersectRegion, /* 116 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK - TkIntersectRegion, /* 116 */ -#endif /* MAC_OSX_TK */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - NULL, /* 117 */ -#endif /* UNIX */ -#ifdef __WIN32__ - TkRectInRegion, /* 117 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - TkRectInRegion, /* 117 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK TkRectInRegion, /* 117 */ -#endif /* MAC_OSX_TK */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - NULL, /* 118 */ -#endif /* UNIX */ -#ifdef __WIN32__ TkSetRegion, /* 118 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - TkSetRegion, /* 118 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK - TkSetRegion, /* 118 */ -#endif /* MAC_OSX_TK */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - NULL, /* 119 */ -#endif /* UNIX */ -#ifdef __WIN32__ - TkUnionRectWithRegion, /* 119 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL - TkUnionRectWithRegion, /* 119 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK TkUnionRectWithRegion, /* 119 */ -#endif /* MAC_OSX_TK */ NULL, /* 120 */ #if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ NULL, /* 121 */ @@ -318,18 +282,7 @@ TkIntStubs tkIntStubs = { TkFocusFree, /* 142 */ TkClipCleanup, /* 143 */ TkGCCleanup, /* 144 */ -#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ - NULL, /* 145 */ -#endif /* UNIX */ -#ifdef __WIN32__ - TkSubtractRegion, /* 145 */ -#endif /* __WIN32__ */ -#ifdef MAC_TCL TkSubtractRegion, /* 145 */ -#endif /* MAC_TCL */ -#ifdef MAC_OSX_TK - TkSubtractRegion, /* 145 */ -#endif /* MAC_OSX_TK */ TkStylePkgInit, /* 146 */ TkStylePkgFree, /* 147 */ TkToplevelWindowForCommand, /* 148 */ @@ -826,6 +779,14 @@ TkIntXlibStubs tkIntXlibStubs = { TkPlatStubs tkPlatStubs = { TCL_STUB_MAGIC, NULL, +#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */ + Tk_AttachHWND, /* 0 */ + Tk_GetHINSTANCE, /* 1 */ + Tk_GetHWND, /* 2 */ + Tk_HWNDToWindow, /* 3 */ + Tk_PointerEvent, /* 4 */ + Tk_TranslateWinEvent, /* 5 */ +#endif /* UNIX */ #ifdef __WIN32__ Tk_AttachHWND, /* 0 */ Tk_GetHINSTANCE, /* 1 */ diff --git a/generic/tkWindow.c b/generic/tkWindow.c index d3de72d..a04777f 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -101,6 +101,7 @@ static CONST XSetWindowAttributes defAtts= { #define ISSAFE 1 #define PASSMAINWINDOW 2 +#define WINMACONLY 4 typedef struct { CONST char *name; /* Name of command. */ @@ -135,9 +136,9 @@ static CONST TkCmd commands[] = { {"tkwait", NULL, Tk_TkwaitObjCmd, PASSMAINWINDOW|ISSAFE}, #if defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK) {"tk_chooseColor", NULL, Tk_ChooseColorObjCmd, PASSMAINWINDOW}, - {"tk_chooseDirectory", NULL, Tk_ChooseDirectoryObjCmd, PASSMAINWINDOW}, - {"tk_getOpenFile", NULL, Tk_GetOpenFileObjCmd, PASSMAINWINDOW}, - {"tk_getSaveFile", NULL, Tk_GetSaveFileObjCmd, PASSMAINWINDOW}, + {"tk_chooseDirectory", NULL, Tk_ChooseDirectoryObjCmd, WINMACONLY|PASSMAINWINDOW}, + {"tk_getOpenFile", NULL, Tk_GetOpenFileObjCmd, WINMACONLY|PASSMAINWINDOW}, + {"tk_getSaveFile", NULL, Tk_GetSaveFileObjCmd, WINMACONLY|PASSMAINWINDOW}, #endif #if defined(__WIN32__) || defined(MAC_OSX_TK) {"tk_messageBox", NULL, Tk_MessageBoxObjCmd, PASSMAINWINDOW}, @@ -851,6 +852,9 @@ TkCreateMainWindow(interp, screenName, baseName) Tk_Window tkwin; int dummy; int isSafe; +#ifdef __WIN32__ + int isWin32 = 0; +#endif Tcl_HashEntry *hPtr; register TkMainInfo *mainPtr; register TkWindow *winPtr; @@ -858,7 +862,15 @@ TkCreateMainWindow(interp, screenName, baseName) ClientData clientData; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - +#ifdef __WIN32__ + Tcl_Obj *stringObjPtr = Tcl_GetVar2Ex(interp, "::tcl_platform", "platform", 0); + + if (stringObjPtr + && !strcmp(Tcl_GetString(stringObjPtr), "windows")) { + isWin32 = 1; + } +#endif + /* * Panic if someone updated the TkWindow structure without * also updating the Tk_FakeWin structure (or vice versa). @@ -941,6 +953,11 @@ TkCreateMainWindow(interp, screenName, baseName) if ((cmdPtr->cmdProc == NULL) && (cmdPtr->objProc == NULL)) { Tcl_Panic("TkCreateMainWindow: builtin command with NULL string and object procs"); } +#ifdef __WIN32__ + if (!isWin32 && (cmdPtr->flags & WINMACONLY)) { + continue; + } +#endif if (cmdPtr->flags & PASSMAINWINDOW) { clientData = (ClientData) tkwin; } else { diff --git a/unix/Makefile.in b/unix/Makefile.in index b43c1ef..8a3856b 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -56,6 +56,7 @@ BIN_INSTALL_DIR = $(INSTALL_ROOT)$(bindir) # Directory in which to install the .a or .so binary for the Tk library: LIB_INSTALL_DIR = $(INSTALL_ROOT)$(libdir) +DLL_INSTALL_DIR = @DLL_INSTALL_DIR@ # Path name to use when installing library scripts. SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(TK_LIBRARY) @@ -643,9 +644,9 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish echo "}";\ ) > $(PKG_INDEX); \ fi - @echo "Installing $(LIB_FILE) to $(LIB_INSTALL_DIR)/" + @echo "Installing $(LIB_FILE) to $(DLL_INSTALL_DIR)/" @@INSTALL_LIB@ - @chmod 555 $(LIB_INSTALL_DIR)/$(LIB_FILE) + @chmod 555 $(DLL_INSTALL_DIR)/$(LIB_FILE) @if test "$(TK_BUILD_EXP_FILE)" != ""; then \ echo "Installing $(TK_EXP_FILE) to $(LIB_INSTALL_DIR)/"; \ $(INSTALL_DATA) $(TK_BUILD_EXP_FILE) \ diff --git a/unix/configure b/unix/configure index 0e2a252..6a3a75b 100755 --- a/unix/configure +++ b/unix/configure @@ -2778,7 +2778,6 @@ echo "$ac_t""$tcl_cv_cc_m64" 1>&6 CFLAGS="$CFLAGS -fno-inline" fi - # XIM peeking works under XFree86. cat >> confdefs.h <<\EOF #define PEEK_XCLOSEIM 1 EOF @@ -2799,17 +2798,17 @@ EOF else ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dld.h""... $ac_c" 1>&6 -echo "configure:2803: checking for dld.h" >&5 +echo "configure:2802: checking for dld.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2813: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2812: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2878,17 +2877,17 @@ fi # Not available on all versions: check for include file. ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:2882: checking for dlfcn.h" >&5 +echo "configure:2881: checking for dlfcn.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2892: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2891: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2916,13 +2915,13 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi echo $ac_n "checking for ELF""... $ac_c" 1>&6 -echo "configure:2920: checking for ELF" >&5 +echo "configure:2919: checking for ELF" >&5 if eval "test \"`echo '$''{'tcl_cv_ld_elf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:3005: checking for ELF" >&5 +echo "configure:3004: checking for ELF" >&5 if eval "test \"`echo '$''{'tcl_cv_ld_elf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 case `arch` in ppc) echo $ac_n "checking if compiler accepts -arch ppc64 flag""... $ac_c" 1>&6 -echo "configure:3113: checking if compiler accepts -arch ppc64 flag" >&5 +echo "configure:3112: checking if compiler accepts -arch ppc64 flag" >&5 if eval "test \"`echo '$''{'tcl_cv_cc_arch_ppc64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3117,14 +3116,14 @@ else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcl_cv_cc_arch_ppc64=yes else @@ -3144,7 +3143,7 @@ echo "$ac_t""$tcl_cv_cc_arch_ppc64" 1>&6 fi;; i386) echo $ac_n "checking if compiler accepts -arch x86_64 flag""... $ac_c" 1>&6 -echo "configure:3148: checking if compiler accepts -arch x86_64 flag" >&5 +echo "configure:3147: checking if compiler accepts -arch x86_64 flag" >&5 if eval "test \"`echo '$''{'tcl_cv_cc_arch_x86_64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3152,14 +3151,14 @@ else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch x86_64" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcl_cv_cc_arch_x86_64=yes else @@ -3188,7 +3187,7 @@ echo "$ac_t""$tcl_cv_cc_arch_x86_64" 1>&6 fi SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS}' echo $ac_n "checking if ld accepts -single_module flag""... $ac_c" 1>&6 -echo "configure:3192: checking if ld accepts -single_module flag" >&5 +echo "configure:3191: checking if ld accepts -single_module flag" >&5 if eval "test \"`echo '$''{'tcl_cv_ld_single_module'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3196,14 +3195,14 @@ else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcl_cv_ld_single_module=yes else @@ -3229,7 +3228,7 @@ echo "$ac_t""$tcl_cv_ld_single_module" 1>&6 LDFLAGS="$LDFLAGS -prebind" LDFLAGS="$LDFLAGS -headerpad_max_install_names" echo $ac_n "checking if ld accepts -search_paths_first flag""... $ac_c" 1>&6 -echo "configure:3233: checking if ld accepts -search_paths_first flag" >&5 +echo "configure:3232: checking if ld accepts -search_paths_first flag" >&5 if eval "test \"`echo '$''{'tcl_cv_ld_search_paths_first'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3237,14 +3236,14 @@ else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcl_cv_ld_search_paths_first=yes else @@ -3267,7 +3266,7 @@ echo "$ac_t""$tcl_cv_ld_search_paths_first" 1>&6 PLAT_OBJS=\$\(MAC\_OSX_OBJS\) PLAT_SRCS=\$\(MAC\_OSX_SRCS\) echo $ac_n "checking whether to use CoreFoundation""... $ac_c" 1>&6 -echo "configure:3271: checking whether to use CoreFoundation" >&5 +echo "configure:3270: checking whether to use CoreFoundation" >&5 # Check whether --enable-corefoundation or --disable-corefoundation was given. if test "${enable_corefoundation+set}" = set; then enableval="$enable_corefoundation" @@ -3279,7 +3278,7 @@ fi echo "$ac_t""$tcl_corefoundation" 1>&6 if test $tcl_corefoundation = yes; then echo $ac_n "checking for CoreFoundation.framework""... $ac_c" 1>&6 -echo "configure:3283: checking for CoreFoundation.framework" >&5 +echo "configure:3282: checking for CoreFoundation.framework" >&5 if eval "test \"`echo '$''{'tcl_cv_lib_corefoundation'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3293,14 +3292,14 @@ else done; fi LIBS="$LIBS -framework CoreFoundation" cat > conftest.$ac_ext < int main() { CFBundleRef b = CFBundleGetMainBundle(); ; return 0; } EOF -if { (eval echo configure:3304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcl_cv_lib_corefoundation=yes else @@ -3327,7 +3326,7 @@ EOF fi if test "$fat_32_64" = yes -a $tcl_corefoundation = yes; then echo $ac_n "checking for 64-bit CoreFoundation""... $ac_c" 1>&6 -echo "configure:3331: checking for 64-bit CoreFoundation" >&5 +echo "configure:3330: checking for 64-bit CoreFoundation" >&5 if eval "test \"`echo '$''{'tcl_cv_lib_corefoundation_64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3336,14 +3335,14 @@ else eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' done cat > conftest.$ac_ext < int main() { CFBundleRef b = CFBundleGetMainBundle(); ; return 0; } EOF -if { (eval echo configure:3347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcl_cv_lib_corefoundation_64=yes else @@ -3672,7 +3671,7 @@ EOF # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. echo $ac_n "checking for ld accepts -Bexport flag""... $ac_c" 1>&6 -echo "configure:3676: checking for ld accepts -Bexport flag" >&5 +echo "configure:3675: checking for ld accepts -Bexport flag" >&5 if eval "test \"`echo '$''{'tcl_cv_ld_Bexport'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3680,14 +3679,14 @@ else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bexport" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcl_cv_ld_Bexport=yes else @@ -3737,13 +3736,13 @@ echo "$ac_t""$tcl_cv_ld_Bexport" 1>&6 if test "x$DL_OBJS" = "xtclLoadAout.o" ; then echo $ac_n "checking sys/exec.h""... $ac_c" 1>&6 -echo "configure:3741: checking sys/exec.h" >&5 +echo "configure:3740: checking sys/exec.h" >&5 if eval "test \"`echo '$''{'tcl_cv_sysexec_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -3761,7 +3760,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3765: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3764: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_sysexec_h=usable else @@ -3781,13 +3780,13 @@ EOF else echo $ac_n "checking a.out.h""... $ac_c" 1>&6 -echo "configure:3785: checking a.out.h" >&5 +echo "configure:3784: checking a.out.h" >&5 if eval "test \"`echo '$''{'tcl_cv_aout_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -3805,7 +3804,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3809: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3808: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_aout_h=usable else @@ -3825,13 +3824,13 @@ EOF else echo $ac_n "checking sys/exec_aout.h""... $ac_c" 1>&6 -echo "configure:3829: checking sys/exec_aout.h" >&5 +echo "configure:3828: checking sys/exec_aout.h" >&5 if eval "test \"`echo '$''{'tcl_cv_sysexecaout_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -3849,7 +3848,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3853: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3852: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_sysexecaout_h=usable else @@ -3929,11 +3928,17 @@ fi if test "$UNSHARED_LIB_SUFFIX" = "" ; then UNSHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' fi + DLL_INSTALL_DIR="\$(LIB_INSTALL_DIR)" if test "${SHARED_BUILD}" = "1" && test "${SHLIB_SUFFIX}" != "" ; then LIB_SUFFIX=${SHARED_LIB_SUFFIX} MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)' + if test "${SHLIB_SUFFIX}" = ".dll"; then + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(BIN_INSTALL_DIR)/$(LIB_FILE)' + DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" + else + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)' + fi else LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} @@ -3961,12 +3966,12 @@ fi # warning when initializing a union member. echo $ac_n "checking for cast to union support""... $ac_c" 1>&6 -echo "configure:3965: checking for cast to union support" >&5 +echo "configure:3970: checking for cast to union support" >&5 if eval "test \"`echo '$''{'tcl_cv_cast_to_union'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_cast_to_union=yes else @@ -4026,11 +4031,12 @@ EOF + echo $ac_n "checking for build with symbols""... $ac_c" 1>&6 -echo "configure:4034: checking for build with symbols" >&5 +echo "configure:4040: checking for build with symbols" >&5 # Check whether --enable-symbols or --disable-symbols was given. if test "${enable_symbols+set}" = set; then enableval="$enable_symbols" @@ -4095,21 +4101,21 @@ TK_DBGX=${DBGX} echo $ac_n "checking for required early compiler flags""... $ac_c" 1>&6 -echo "configure:4099: checking for required early compiler flags" >&5 +echo "configure:4105: checking for required early compiler flags" >&5 tcl_flags="" if eval "test \"`echo '$''{'tcl_cv_flag__isoc99_source'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } EOF -if { (eval echo configure:4113: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_flag__isoc99_source=no else @@ -4117,7 +4123,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < @@ -4125,7 +4131,7 @@ int main() { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } EOF -if { (eval echo configure:4129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_flag__isoc99_source=yes else @@ -4152,14 +4158,14 @@ EOF echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } EOF -if { (eval echo configure:4163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4169: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_flag__largefile64_source=no else @@ -4167,7 +4173,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < @@ -4175,7 +4181,7 @@ int main() { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } EOF -if { (eval echo configure:4179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4185: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_flag__largefile64_source=yes else @@ -4202,14 +4208,14 @@ EOF echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = (char *)open64; ; return 0; } EOF -if { (eval echo configure:4213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_flag__largefile_source64=no else @@ -4217,7 +4223,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < @@ -4225,7 +4231,7 @@ int main() { char *p = (char *)open64; ; return 0; } EOF -if { (eval echo configure:4229: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4235: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_flag__largefile_source64=yes else @@ -4256,7 +4262,7 @@ EOF echo $ac_n "checking for 64-bit integer type""... $ac_c" 1>&6 -echo "configure:4260: checking for 64-bit integer type" >&5 +echo "configure:4266: checking for 64-bit integer type" >&5 if eval "test \"`echo '$''{'tcl_cv_type_64bit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4264,14 +4270,14 @@ else tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_type_64bit=__int64 else @@ -4285,7 +4291,7 @@ rm -f conftest* # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4304: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_type_64bit=${tcl_type_64bit} else @@ -4319,13 +4325,13 @@ EOF # Now check for auxiliary declarations echo $ac_n "checking for struct dirent64""... $ac_c" 1>&6 -echo "configure:4323: checking for struct dirent64" >&5 +echo "configure:4329: checking for struct dirent64" >&5 if eval "test \"`echo '$''{'tcl_cv_struct_dirent64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4333,7 +4339,7 @@ int main() { struct dirent64 p; ; return 0; } EOF -if { (eval echo configure:4337: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4343: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_struct_dirent64=yes else @@ -4354,13 +4360,13 @@ EOF fi echo $ac_n "checking for struct stat64""... $ac_c" 1>&6 -echo "configure:4358: checking for struct stat64" >&5 +echo "configure:4364: checking for struct stat64" >&5 if eval "test \"`echo '$''{'tcl_cv_struct_stat64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -4368,7 +4374,7 @@ struct stat64 p; ; return 0; } EOF -if { (eval echo configure:4372: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_struct_stat64=yes else @@ -4391,12 +4397,12 @@ EOF for ac_func in open64 lseek64 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4395: checking for $ac_func" >&5 +echo "configure:4401: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4444,13 +4450,13 @@ fi done echo $ac_n "checking for off64_t""... $ac_c" 1>&6 -echo "configure:4448: checking for off64_t" >&5 +echo "configure:4454: checking for off64_t" >&5 if eval "test \"`echo '$''{'tcl_cv_type_off64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -4458,7 +4464,7 @@ off64_t offset; ; return 0; } EOF -if { (eval echo configure:4462: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4468: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_type_off64_t=yes else @@ -4489,14 +4495,14 @@ EOF #-------------------------------------------------------------------- echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:4493: checking whether byte ordering is bigendian" >&5 +echo "configure:4499: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -4507,11 +4513,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:4511: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4517: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -4522,7 +4528,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:4526: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4532: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -4542,7 +4548,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -4607,20 +4613,20 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking for fd_set in sys/types""... $ac_c" 1>&6 -echo "configure:4611: checking for fd_set in sys/types" >&5 +echo "configure:4617: checking for fd_set in sys/types" >&5 if eval "test \"`echo '$''{'tcl_cv_type_fd_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { fd_set readMask, writeMask; ; return 0; } EOF -if { (eval echo configure:4624: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4630: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_type_fd_set=yes else @@ -4636,13 +4642,13 @@ echo "$ac_t""$tcl_cv_type_fd_set" 1>&6 tk_ok=$tcl_cv_type_fd_set if test $tk_ok = no; then echo $ac_n "checking for fd_mask in sys/select""... $ac_c" 1>&6 -echo "configure:4640: checking for fd_mask in sys/select" >&5 +echo "configure:4646: checking for fd_mask in sys/select" >&5 if eval "test \"`echo '$''{'tcl_cv_grep_fd_mask'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -4682,17 +4688,17 @@ for ac_hdr in sys/time.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4686: checking for $ac_hdr" >&5 +echo "configure:4692: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4696: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4719,12 +4725,12 @@ fi done echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:4723: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:4729: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4733,7 +4739,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:4737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4743: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -4763,12 +4769,12 @@ fi echo $ac_n "checking for strtod""... $ac_c" 1>&6 -echo "configure:4767: checking for strtod" >&5 +echo "configure:4773: checking for strtod" >&5 if eval "test \"`echo '$''{'ac_cv_func_strtod'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strtod=yes" else @@ -4813,7 +4819,7 @@ fi if test "$tcl_strtod" = 1; then echo $ac_n "checking for Solaris2.4/Tru64 strtod bugs""... $ac_c" 1>&6 -echo "configure:4817: checking for Solaris2.4/Tru64 strtod bugs" >&5 +echo "configure:4823: checking for Solaris2.4/Tru64 strtod bugs" >&5 if eval "test \"`echo '$''{'tcl_cv_strtod_buggy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4822,7 +4828,7 @@ else tcl_cv_strtod_buggy=buggy else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_strtod_buggy=ok else @@ -4876,12 +4882,12 @@ EOF #-------------------------------------------------------------------- echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:4880: checking for ANSI C header files" >&5 +echo "configure:4886: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4889,7 +4895,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4893: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4899: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4906,7 +4912,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -4924,7 +4930,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -4945,7 +4951,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -4956,7 +4962,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:4960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -4980,12 +4986,12 @@ EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:4984: checking for mode_t" >&5 +echo "configure:4990: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5013,12 +5019,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:5017: checking for pid_t" >&5 +echo "configure:5023: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5046,12 +5052,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:5050: checking for size_t" >&5 +echo "configure:5056: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -5079,12 +5085,12 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:5083: checking for uid_t in sys/types.h" >&5 +echo "configure:5089: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -5118,20 +5124,20 @@ fi #------------------------------------------- echo $ac_n "checking pw_gecos in struct pwd""... $ac_c" 1>&6 -echo "configure:5122: checking pw_gecos in struct pwd" >&5 +echo "configure:5128: checking pw_gecos in struct pwd" >&5 if eval "test \"`echo '$''{'tcl_cv_pwd_pw_gecos'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct passwd pwd; pwd.pw_gecos; ; return 0; } EOF -if { (eval echo configure:5135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_pwd_pw_gecos=yes else @@ -5157,7 +5163,7 @@ fi if test "`uname -s`" = "Darwin" ; then echo $ac_n "checking whether to use Aqua""... $ac_c" 1>&6 -echo "configure:5161: checking whether to use Aqua" >&5 +echo "configure:5167: checking whether to use Aqua" >&5 # Check whether --enable-aqua or --disable-aqua was given. if test "${enable_aqua+set}" = set; then enableval="$enable_aqua" @@ -5184,7 +5190,7 @@ fi if test "$fat_32_64" = yes; then if test $tk_aqua = no; then echo $ac_n "checking for 64-bit X11""... $ac_c" 1>&6 -echo "configure:5188: checking for 64-bit X11" >&5 +echo "configure:5194: checking for 64-bit X11" >&5 if eval "test \"`echo '$''{'tcl_cv_lib_x11_64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5195,14 +5201,14 @@ else CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11" cat > conftest.$ac_ext < int main() { XrmInitialize(); ; return 0; } EOF -if { (eval echo configure:5206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcl_cv_lib_x11_64=yes else @@ -5262,7 +5268,7 @@ else # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:5266: checking for X" >&5 +echo "configure:5272: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -5324,12 +5330,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5333: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5339: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5398,14 +5404,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -5495,12 +5501,12 @@ fi if test "$no_x" = ""; then if test "$x_includes" = ""; then cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5504: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -5520,15 +5526,15 @@ rm -f conftest* fi if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then echo $ac_n "checking for X11 header files""... $ac_c" 1>&6 -echo "configure:5524: checking for X11 header files" >&5 +echo "configure:5530: checking for X11 header files" >&5 found_xincludes="no" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5532: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5564,7 +5570,7 @@ rm -f conftest* if test "$no_x" = yes; then echo $ac_n "checking for X11 libraries""... $ac_c" 1>&6 -echo "configure:5568: checking for X11 libraries" >&5 +echo "configure:5574: checking for X11 libraries" >&5 XLIBSW=nope dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" for i in $dirs ; do @@ -5584,7 +5590,7 @@ echo "configure:5568: checking for X11 libraries" >&5 fi if test "$XLIBSW" = nope ; then echo $ac_n "checking for XCreateWindow in -lXwindow""... $ac_c" 1>&6 -echo "configure:5588: checking for XCreateWindow in -lXwindow" >&5 +echo "configure:5594: checking for XCreateWindow in -lXwindow" >&5 ac_lib_var=`echo Xwindow'_'XCreateWindow | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5592,7 +5598,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXwindow $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5680,7 +5686,7 @@ eval "LD_SEARCH_FLAGS=\"$TCL_LD_SEARCH_FLAGS\"" if test $tk_aqua = no; then echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6 -echo "configure:5684: checking for main in -lXbsd" >&5 +echo "configure:5690: checking for main in -lXbsd" >&5 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5688,14 +5694,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lXbsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5719,12 +5725,12 @@ fi tk_checkBoth=0 echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:5723: checking for connect" >&5 +echo "configure:5729: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -5769,7 +5775,7 @@ fi if test "$tk_checkSocket" = 1; then echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 -echo "configure:5773: checking for main in -lsocket" >&5 +echo "configure:5779: checking for main in -lsocket" >&5 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5777,14 +5783,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5810,12 +5816,12 @@ if test "$tk_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" echo $ac_n "checking for accept""... $ac_c" 1>&6 -echo "configure:5814: checking for accept" >&5 +echo "configure:5820: checking for accept" >&5 if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_accept=yes" else @@ -5860,12 +5866,12 @@ fi fi echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:5864: checking for gethostbyname" >&5 +echo "configure:5870: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -5906,7 +5912,7 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 -echo "configure:5910: checking for main in -lnsl" >&5 +echo "configure:5916: checking for main in -lnsl" >&5 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5914,14 +5920,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5957,13 +5963,13 @@ fi if test -d /usr/include/mit -a $tk_aqua = no; then echo $ac_n "checking MIT X libraries""... $ac_c" 1>&6 -echo "configure:5961: checking MIT X libraries" >&5 +echo "configure:5967: checking MIT X libraries" >&5 tk_oldCFlags=$CFLAGS CFLAGS="$CFLAGS -I/usr/include/mit" tk_oldLibs=$LIBS LIBS="$LIBS -lX11-mit" cat > conftest.$ac_ext < @@ -5974,7 +5980,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 @@ -5998,14 +6004,14 @@ fi #-------------------------------------------------------------------- echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6 -echo "configure:6002: checking whether char is unsigned" >&5 +echo "configure:6008: checking whether char is unsigned" >&5 if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$GCC" = yes; then # GCC predefines this symbol on systems where it applies. cat > conftest.$ac_ext <&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_char_unsigned=yes else @@ -6098,7 +6104,7 @@ if test "`uname -s`" = "Darwin" ; then if test "`uname -s`" = "Darwin" ; then echo $ac_n "checking how to package libraries""... $ac_c" 1>&6 -echo "configure:6102: checking how to package libraries" >&5 +echo "configure:6108: checking how to package libraries" >&5 # Check whether --enable-framework or --disable-framework was given. if test "${enable_framework+set}" = set; then enableval="$enable_framework" @@ -6494,6 +6500,7 @@ s%@SHLIB_SUFFIX@%$SHLIB_SUFFIX%g s%@MAKE_LIB@%$MAKE_LIB%g s%@MAKE_STUB_LIB@%$MAKE_STUB_LIB%g s%@INSTALL_LIB@%$INSTALL_LIB%g +s%@DLL_INSTALL_DIR@%$DLL_INSTALL_DIR%g s%@INSTALL_STUB_LIB@%$INSTALL_STUB_LIB%g s%@CFLAGS_DEFAULT@%$CFLAGS_DEFAULT%g s%@LDFLAGS_DEFAULT@%$LDFLAGS_DEFAULT%g diff --git a/unix/tcl.m4 b/unix/tcl.m4 index c804072..2391a41 100755 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1168,7 +1168,7 @@ dnl AC_CHECK_TOOL(AR, ar) AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no) if test $libbsd = yes; then MATH_LIBS="$MATH_LIBS -lbsd" - AC_DEFINE(USE_DELTA_FOR_TZ) + AC_DEFINE(USE_DELTA_FOR_TZ, 1, [Use delta for TZ]) fi ;; BeOS*) @@ -1440,8 +1440,8 @@ dnl AC_CHECK_TOOL(AR, ar) CFLAGS="$CFLAGS -fno-inline" fi - # XIM peeking works under XFree86. - AC_DEFINE(PEEK_XCLOSEIM) + AC_DEFINE(PEEK_XCLOSEIM, 1, + [XIM peeking works under XFree86]) ;; GNU*) @@ -1742,7 +1742,8 @@ dnl AC_CHECK_TOOL(AR, ar) done; fi; LIBS=$hold_libs]) if test $tcl_cv_lib_corefoundation = yes; then LIBS="$LIBS -framework CoreFoundation" - AC_DEFINE(HAVE_COREFOUNDATION) + AC_DEFINE(HAVE_COREFOUNDATION, 1, + [Do we have access to Darwin CoreFoundation.framework?]) else tcl_corefoundation=no fi @@ -1758,7 +1759,8 @@ dnl AC_CHECK_TOOL(AR, ar) eval $v'="$hold_'$v'"' done]) if test $tcl_cv_lib_corefoundation_64 = no; then - AC_DEFINE(NO_COREFOUNDATION_64) + AC_DEFINE(NO_COREFOUNDATION_64, 1, + [Is Darwin CoreFoundation unavailable for 64-bit?]) fi fi fi @@ -2197,11 +2199,17 @@ dnl # preprocessing tests use only CPPFLAGS. if test "$UNSHARED_LIB_SUFFIX" = "" ; then UNSHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' fi + DLL_INSTALL_DIR="\$(LIB_INSTALL_DIR)" if test "${SHARED_BUILD}" = "1" && test "${SHLIB_SUFFIX}" != "" ; then LIB_SUFFIX=${SHARED_LIB_SUFFIX} MAKE_LIB='${SHLIB_LD} -o [$]@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)' + if test "${SHLIB_SUFFIX}" = ".dll"; then + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(BIN_INSTALL_DIR)/$(LIB_FILE)' + DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" + else + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)' + fi else LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} @@ -2270,6 +2278,7 @@ dnl # preprocessing tests use only CPPFLAGS. AC_SUBST(MAKE_LIB) AC_SUBST(MAKE_STUB_LIB) AC_SUBST(INSTALL_LIB) + AC_SUBST(DLL_INSTALL_DIR) AC_SUBST(INSTALL_STUB_LIB) AC_SUBST(RANLIB) ]) -- cgit v0.12 From 8a45d9cff4f3ae233e7eb8405aaab0ec90596cca Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 26 Apr 2012 12:36:48 +0000 Subject: provide dummy Tk_AttachHWND and friends for OSX as well --- generic/tkStubInit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index d37dd4c..2a8fd07 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -55,12 +55,14 @@ * the stub table, call TkParseColor in stead. See bug #3486474 */ # define XParseColor TkParseColor -# if !defined(MAC_TCL) && !defined(MAC_OSX_TCL) +# ifndef __CYGWIN__ # define Tk_AttachHWND 0 # define Tk_GetHWND 0 # define Tk_HWNDToWindow 0 # define Tk_PointerEvent 0 # define Tk_TranslateWinEvent 0 +# endif +# if !defined(MAC_TCL) && !defined(MAC_OSX_TCL) # define TkClipBox (void (*) _ANSI_ARGS_((TkRegion, XRectangle *))) XClipBox # define TkCreateRegion (TkRegion (*) ()) XCreateRegion # define TkDestroyRegion (void (*) _ANSI_ARGS_((TkRegion))) XDestroyRegion -- cgit v0.12 From 92dc17bde5685c5249794b0ef519d9597139c5f4 Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 26 Apr 2012 13:46:50 +0000 Subject: Ensure that Tk_GetHINSTANCE is defined on OSX. --- ChangeLog | 5 +++++ generic/tkStubInit.c | 45 +++++++++++++++++++++++++-------------------- 2 files changed, 30 insertions(+), 20 deletions(-) mode change 100755 => 100644 ChangeLog diff --git a/ChangeLog b/ChangeLog old mode 100755 new mode 100644 index d4d5c3e..cdfcd5b --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-04-26 Donal K. Fellows + + * generic/tkStubInit.c (Tk_GetHINSTANCE): Ensure that this is defined + for OSX. + 2012-04-26 Jan Nijtmans * generic/tk.decls: [Bug 3508771]: Implement TkClipBox, Tk*Region and diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 2a8fd07..6b36f7b 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -51,16 +51,19 @@ #undef TkPutImage #ifndef __WIN32__ -/* Make sure that extensions which call XParseColor through - * the stub table, call TkParseColor in stead. See bug #3486474 */ -# define XParseColor TkParseColor +/* + * Make sure that extensions which call XParseColor through the stub + * table, call TkParseColor instead. [Bug 3486474] + */ +# define XParseColor TkParseColor # ifndef __CYGWIN__ -# define Tk_AttachHWND 0 -# define Tk_GetHWND 0 -# define Tk_HWNDToWindow 0 -# define Tk_PointerEvent 0 -# define Tk_TranslateWinEvent 0 +# define Tk_AttachHWND 0 +# define Tk_GetHWND 0 +# define Tk_HWNDToWindow 0 +# define Tk_PointerEvent 0 +# define Tk_TranslateWinEvent 0 +# define Tk_GetHINSTANCE 0 # endif # if !defined(MAC_TCL) && !defined(MAC_OSX_TCL) # define TkClipBox (void (*) _ANSI_ARGS_((TkRegion, XRectangle *))) XClipBox @@ -72,30 +75,32 @@ # define TkUnionRectWithRegion (void (*) _ANSI_ARGS_((XRectangle *, TkRegion, TkRegion))) XUnionRectWithRegion # define TkSubtractRegion (void (*) _ANSI_ARGS_((TkRegion, TkRegion, TkRegion))) XSubtractRegion -#ifdef __CYGWIN__ -/* Trick, so we don't have to include here, which - * - b.t.w. - lacks this function anyway */ -#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004 +# ifdef __CYGWIN__ +# define Tk_GetHINSTANCE TkPlatGetHINSTANCE +# define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004 + +/* + * Trick, so we don't have to include here, which in any + * case lacks this function anyway. + */ + int __stdcall GetModuleHandleExW(unsigned int, const char *, void *); TkIntStubs tkIntStubs; -#define Tk_GetHINSTANCE TkPlatGetHINSTANCE static void *Tk_GetHINSTANCE() { void *hInstance = NULL; + GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, - (const char *)&tkIntStubs, &hInstance); + (const char *) &tkIntStubs, &hInstance); return hInstance; } -#else /* __CYGWIN__ */ -# define Tk_GetHINSTANCE 0 -# define TkPutImage 0 -#endif /* __CYGWIN__ */ - +# else /* !__CYGWIN__ */ +# define TkPutImage 0 +# endif /* __CYGWIN__ */ # endif /* !MAC_TCL && !MACC_OSX_TCL */ - #endif /* !__WIN32__ */ /* -- cgit v0.12