summaryrefslogtreecommitdiffstats
path: root/generic/tclNotify.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2021-03-31 10:45:40 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2021-03-31 10:45:40 (GMT)
commit5ca6887e668192a78c3970398c98a574210c6296 (patch)
treeea647bddb6edee5c6e49afb1df96628a1687a128 /generic/tclNotify.c
parent4c25696376a8c5d1f66c51a06193e8dc815287f7 (diff)
downloadtcl-5ca6887e668192a78c3970398c98a574210c6296.zip
tcl-5ca6887e668192a78c3970398c98a574210c6296.tar.gz
tcl-5ca6887e668192a78c3970398c98a574210c6296.tar.bz2
Don't define Tcl_CreateFileHandler or Tcl_DeleteFileHandler on Windows.
Diffstat (limited to 'generic/tclNotify.c')
-rw-r--r--generic/tclNotify.c142
1 files changed, 76 insertions, 66 deletions
diff --git a/generic/tclNotify.c b/generic/tclNotify.c
index fbf8360..9b5234b 100644
--- a/generic/tclNotify.c
+++ b/generic/tclNotify.c
@@ -1224,72 +1224,6 @@ Tcl_FinalizeNotifier(
/*
*----------------------------------------------------------------------
*
- * Tcl_CreateFileHandler --
- *
- * This function registers a file descriptor handler with the notifier.
- * Forwards to the platform implementation when the hook is not enabled.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Creates a new file handler structure.
- *
- *----------------------------------------------------------------------
- */
-
-void
-Tcl_CreateFileHandler(
- int fd, /* Handle of stream to watch. */
- int mask, /* OR'ed combination of TCL_READABLE,
- * TCL_WRITABLE, and TCL_EXCEPTION: indicates
- * conditions under which proc should be
- * called. */
- Tcl_FileProc *proc, /* Function to call for each selected
- * event. */
- ClientData clientData) /* Arbitrary data to pass to proc. */
-{
- if (tclNotifierHooks.createFileHandlerProc) {
- tclNotifierHooks.createFileHandlerProc(fd, mask, proc, clientData);
- } else {
- TclpCreateFileHandler(fd, mask, proc, clientData);
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
- * Tcl_DeleteFileHandler --
- *
- * Cancel a previously-arranged callback arrangement for a file
- * descriptor. Forwards to the platform implementation when the hook is
- * not enabled.
- *
- * Results:
- * None.
- *
- * Side effects:
- * If a callback was previously registered on the file descriptor, remove
- * it.
- *
- *----------------------------------------------------------------------
- */
-
-void
-Tcl_DeleteFileHandler(
- int fd) /* Stream id for which to remove callback
- * function. */
-{
- if (tclNotifierHooks.deleteFileHandlerProc) {
- tclNotifierHooks.deleteFileHandlerProc(fd);
- } else {
- TclpDeleteFileHandler(fd);
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
* Tcl_AlertNotifier --
*
* Wake up the specified notifier from any thread. This routine is called
@@ -1409,6 +1343,82 @@ Tcl_WaitForEvent(
}
/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_CreateFileHandler --
+ *
+ * This function registers a file descriptor handler with the notifier.
+ * Forwards to the platform implementation when the hook is not enabled.
+ *
+ * This function is not defined on Windows. The OS API there is too
+ * different.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Creates a new file handler structure.
+ *
+ *----------------------------------------------------------------------
+ */
+
+#ifndef _WIN32
+void
+Tcl_CreateFileHandler(
+ int fd, /* Handle of stream to watch. */
+ int mask, /* OR'ed combination of TCL_READABLE,
+ * TCL_WRITABLE, and TCL_EXCEPTION: indicates
+ * conditions under which proc should be
+ * called. */
+ Tcl_FileProc *proc, /* Function to call for each selected
+ * event. */
+ ClientData clientData) /* Arbitrary data to pass to proc. */
+{
+ if (tclNotifierHooks.createFileHandlerProc) {
+ tclNotifierHooks.createFileHandlerProc(fd, mask, proc, clientData);
+ } else {
+ TclpCreateFileHandler(fd, mask, proc, clientData);
+ }
+}
+#endif /* !_WIN32 */
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_DeleteFileHandler --
+ *
+ * Cancel a previously-arranged callback arrangement for a file
+ * descriptor. Forwards to the platform implementation when the hook is
+ * not enabled.
+ *
+ * This function is not defined on Windows. The OS API there is too
+ * different.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * If a callback was previously registered on the file descriptor, remove
+ * it.
+ *
+ *----------------------------------------------------------------------
+ */
+
+#ifndef _WIN32
+void
+Tcl_DeleteFileHandler(
+ int fd) /* Stream id for which to remove callback
+ * function. */
+{
+ if (tclNotifierHooks.deleteFileHandlerProc) {
+ tclNotifierHooks.deleteFileHandlerProc(fd);
+ } else {
+ TclpDeleteFileHandler(fd);
+ }
+}
+#endif /* !_WIN32 */
+
+/*
* Local Variables:
* mode: c
* c-basic-offset: 4