summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-26 14:05:39 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-26 14:05:39 (GMT)
commite579396907adac4e3f88da62abfe0ae184180d98 (patch)
treed78f1e0f41c15b94d3bf92d3a925c1ce16195437
parentcaa3f5c131dc0d5004e32a64164567a4328ca136 (diff)
parent8dca7f801721aeb881ce80cb84c05269f80a2a1a (diff)
downloadtk-bug_533519.zip
tk-bug_533519.tar.gz
tk-bug_533519.tar.bz2
merge trunkbug_533519
-rw-r--r--ChangeLog5
-rw-r--r--generic/tkStubInit.c45
2 files changed, 30 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index e47126c..c573d81 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-04-26 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkStubInit.c (Tk_GetHINSTANCE): Ensure that this is defined
+ for OSX.
+
2012-04-26 Jan Nijtmans <nijtmans@users.sf.net>
* generic/tk.decls: [Bug 3508771]: Implement TkClipBox, Tk*Region and
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index 00052f2..fe04206 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -55,16 +55,19 @@ static const TkIntStubs tkIntStubs;
#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 (*) (TkRegion, XRectangle *)) XClipBox
@@ -76,28 +79,30 @@ static const TkIntStubs tkIntStubs;
# define TkUnionRectWithRegion (void (*) (XRectangle *, TkRegion, TkRegion)) XUnionRectWithRegion
# define TkSubtractRegion (void (*) (TkRegion, TkRegion, TkRegion)) XSubtractRegion
-#ifdef __CYGWIN__
-/* Trick, so we don't have to include <windows.h> 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 <windows.h> here, which in any
+ * case lacks this function anyway.
+ */
+
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);
+ (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__ */
/* !BEGIN!: Do not edit below this line. */