summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-31 09:30:22 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-05-31 09:30:22 (GMT)
commit0ad4cbd7bd60324dc875c7d8f472096589c2b024 (patch)
tree3ab0f8a9d922f9c36c5579ff2ee94478091498c8 /win
parenta2b7afd83359a8b5149462e93b174ca5784d1e1a (diff)
downloadtk-0ad4cbd7bd60324dc875c7d8f472096589c2b024.zip
tk-0ad4cbd7bd60324dc875c7d8f472096589c2b024.tar.gz
tk-0ad4cbd7bd60324dc875c7d8f472096589c2b024.tar.bz2
Implement XFlush and various others for win32 as stubs, so win32 extensions using those can run under CYGWIN as well.
Allow tk86.dll to cooperate with the cygwin console.
Diffstat (limited to 'win')
-rw-r--r--win/Makefile.in7
-rw-r--r--win/stubs.c68
-rw-r--r--win/tkWinPort.h21
3 files changed, 74 insertions, 22 deletions
diff --git a/win/Makefile.in b/win/Makefile.in
index 247e183..04e3d85 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -94,6 +94,10 @@ TCL_BIN_DIR = @TCL_BIN_DIR@
# been replaced by the configure script):
TCL_GENERIC_DIR = @TCL_SRC_DIR@/generic
+# The directory containing the platform specific Tcl sources and headers
+# appropriate for this version of Tk:
+TCL_PLATFORM_DIR = @TCL_SRC_DIR@/win
+
TCL_TOOL_DIR = @TCL_SRC_DIR@/tools
# Converts a POSIX path to a Windows native path.
@@ -120,6 +124,7 @@ BITMAP_DIR_NATIVE = $(ROOT_DIR_NATIVE)/bitmaps
XLIB_DIR_NATIVE = $(ROOT_DIR_NATIVE)/xlib
RC_DIR_NATIVE = $(WIN_DIR_NATIVE)/rc
TCL_GENERIC_NATIVE = $(shell $(CYGPATH) '$(TCL_GENERIC_DIR)' | sed 's!\\!/!g')
+TCL_PLATFORM_NATIVE = $(shell $(CYGPATH) '$(TCL_PLATFORM_DIR)' | sed 's!\\!/!g')
TCL_SRC_DIR_NATIVE = $(shell $(CYGPATH) '$(TCL_SRC_DIR)' | sed 's!\\!/!g')
DLLSUFFIX = @DLLSUFFIX@
@@ -208,7 +213,7 @@ TCL_EXE = @TCLSH_PROG@
CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \
-I"${GENERIC_DIR_NATIVE}" -I"${WIN_DIR_NATIVE}" \
-I"${XLIB_DIR_NATIVE}" -I"${BITMAP_DIR_NATIVE}" \
--I"${TCL_GENERIC_NATIVE}" ${AC_FLAGS} -DUSE_TCL_STUBS
+-I"${TCL_GENERIC_NATIVE}" -I"${TCL_PLATFORM_NATIVE}" ${AC_FLAGS} -DUSE_TCL_STUBS
CC_OBJNAME = @CC_OBJNAME@
CC_EXENAME = @CC_EXENAME@
diff --git a/win/stubs.c b/win/stubs.c
index 00030d1..3cd8327 100644
--- a/win/stubs.c
+++ b/win/stubs.c
@@ -386,3 +386,71 @@ XGetWindowProperty(
*prop_return = NULL;
return BadValue;
}
+
+/*
+ * The following functions were implemented as macros under Windows.
+ */
+
+int
+XFlush(
+ Display *display)
+{
+ return 0;
+}
+
+int
+XGrabServer(
+ Display *display)
+{
+ return 0;
+}
+
+int
+XUngrabServer(
+ Display *display)
+{
+ return 0;
+}
+
+int
+XFree(
+ void *data)
+{
+ if ((data) != NULL) {
+ ckfree(data);
+ }
+ return 0;
+}
+
+int
+XNoOp(
+ Display *display)
+{
+ display->request++;
+ return 0;
+}
+
+int
+XSynchronize(
+ Display *display,
+ Bool bool)
+{
+ display->request++;
+ return 0;
+}
+
+int
+XSync(
+ Display *display,
+ Bool bool)
+{
+ display->request++;
+ return 0;
+}
+
+VisualID
+XVisualIDFromVisual(
+ Visual *visual)
+{
+ return visual->visualid;
+}
diff --git a/win/tkWinPort.h b/win/tkWinPort.h
index 75c7d22..fe31609 100644
--- a/win/tkWinPort.h
+++ b/win/tkWinPort.h
@@ -98,27 +98,6 @@
#endif /* _MSC_VER */
/*
- * The following stubs implement various calls that don't do anything
- * under Windows.
- */
-
-#define TkFreeWindowId(dispPtr,w)
-#define TkInitXId(dispPtr)
-#define XFlush(display)
-#define XGrabServer(display)
-#define XUngrabServer(display)
-
-/*
- * The following functions are implemented as macros under Windows.
- */
-
-#define XFree(data) {if ((data) != NULL) ckfree(data);}
-#define XNoOp(display) {display->request++;}
-#define XSynchronize(display, bool) {display->request++;}
-#define XSync(display, bool) {display->request++;}
-#define XVisualIDFromVisual(visual) (visual->visualid)
-
-/*
* The following Tk functions are implemented as macros under Windows.
*/