summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-25 12:19:47 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-25 12:19:47 (GMT)
commitd7e1d66497a877b980042968a57edd01d2840818 (patch)
treec70ccc1c14fdf986ba8530e11b5a1a69b08de298 /unix
parentc6f6c74ebb2092a8b0b4b2e5c805d22253d19e33 (diff)
downloadtk-d7e1d66497a877b980042968a57edd01d2840818.zip
tk-d7e1d66497a877b980042968a57edd01d2840818.tar.gz
tk-d7e1d66497a877b980042968a57edd01d2840818.tar.bz2
Simpify determination whether we are running on cygwin.
Export Tk_GetHINSTANCE, TkSetPixmapColormap and TkpPrintWindowId on the Cygwin dll. Fix "make genstubs" when cross-compiling on UNIX
Diffstat (limited to 'unix')
-rw-r--r--unix/tkUnixPort.h53
1 files changed, 30 insertions, 23 deletions
diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h
index f0affb8..6e03287 100644
--- a/unix/tkUnixPort.h
+++ b/unix/tkUnixPort.h
@@ -125,6 +125,31 @@
# define NBBY 8
#endif
+#ifdef __CYGWIN__
+# define UINT unsigned int
+# define HWND void *
+# define HDC void *
+# define HINSTANCE void *
+# define COLORREF void *
+# define HMENU void *
+# define TkWinDCState void
+# define HPALETTE void *
+# define WNDPROC void *
+# define WPARAM void *
+# define LPARAM void *
+# define LRESULT void *
+#endif /* This really should be an #else, as soon as the Xlib stubs are enabled for Cygwin. */
+ /*
+ * The TkPutImage macro strips off the color table information, which isn't
+ * needed for X.
+ */
+
+# define TkPutImage(colors, ncolors, display, pixels, gc, image, srcx, srcy, destx, desty, width, height) \
+ XPutImage(display, pixels, gc, image, srcx, srcy, destx, \
+ desty, width, height);
+
+/* #endif */
+
/*
* These macros are just wrappers for the equivalent X Region calls.
*/
@@ -141,29 +166,7 @@
#define TkUnionRectWithRegion(rect, src, ret) XUnionRectWithRegion(rect, \
(Region) src, (Region) ret)
-/*
- * The TkPutImage macro strips off the color table information, which isn't
- * needed for X.
- */
-
-#define TkPutImage(colors, ncolors, display, pixels, gc, image, destx, desty, srcx, srcy, width, height) \
- XPutImage(display, pixels, gc, image, destx, desty, srcx, \
- srcy, width, height);
-
-#ifdef __CYGWIN__
-# define UINT unsigned int
-# define HWND void *
-# define HDC void *
-# define HINSTANCE void *
-# define COLORREF void *
-# define HMENU void *
-# define TkWinDCState void
-# define HPALETTE void *
-# define WNDPROC void *
-# define WPARAM void *
-# define LPARAM void *
-# define LRESULT void *
-#endif
+/* #endif */
/*
* Supply macros for seek offsets, if they're not already provided by
@@ -195,7 +198,9 @@
#define TkpButtonSetDefaults(specPtr) {}
#define TkpDestroyButton(butPtr) {}
#define TkSelUpdateClipboard(a,b) {}
+#ifndef __CYGWIN__
#define TkSetPixmapColormap(p,c) {}
+#endif
/*
* These calls implement native bitmaps which are not supported under
@@ -211,8 +216,10 @@
* This should perhaps use the real size of an XID.
*/
+#ifndef __CYGWIN__
#define TkpPrintWindowId(buf,w) \
sprintf((buf), "%#08lx", (unsigned long) (w))
+#endif
/*
* The following declaration is used to get access to a private Tcl interface