summaryrefslogtreecommitdiffstats
path: root/generic/tkStubInit.c
diff options
context:
space:
mode:
authordonal.k.fellows@manchester.ac.uk <dkf>2012-04-26 13:47:42 (GMT)
committerdonal.k.fellows@manchester.ac.uk <dkf>2012-04-26 13:47:42 (GMT)
commit95f2774691cf918952fea1304ad9855ab92f1dad (patch)
treeadbc96bfbf2c90b44b2070256b50a7f36e4a8dda /generic/tkStubInit.c
parent37b3ca5e4b04187ed699b4c758b5270499a65611 (diff)
parent828047c4a5bd7ee90e72ef3fdb761ee046a3cb79 (diff)
downloadtk-95f2774691cf918952fea1304ad9855ab92f1dad.zip
tk-95f2774691cf918952fea1304ad9855ab92f1dad.tar.gz
tk-95f2774691cf918952fea1304ad9855ab92f1dad.tar.bz2
Ensure that Tk_GetHINSTANCE is defined on OSX.
Diffstat (limited to 'generic/tkStubInit.c')
-rw-r--r--generic/tkStubInit.c45
1 files changed, 25 insertions, 20 deletions
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index 6a131ea..6af8946 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -51,16 +51,19 @@ MODULE_SCOPE TkStubs tkStubs;
#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,28 +75,30 @@ MODULE_SCOPE TkStubs tkStubs;
# 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 <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__ */
/*