summaryrefslogtreecommitdiffstats
path: root/win/tclWinPort.h
diff options
context:
space:
mode:
authorashok <ashok>2016-07-09 08:27:00 (GMT)
committerashok <ashok>2016-07-09 08:27:00 (GMT)
commit8435bb9d68cdb26190ded1caca280eaac0314444 (patch)
treebdc4cefb1087197e872b1a580caeaba3bf124e84 /win/tclWinPort.h
parent8c040ee77b5cc022530f195ad1401b0a6762f931 (diff)
downloadtcl-8435bb9d68cdb26190ded1caca280eaac0314444.zip
tcl-8435bb9d68cdb26190ded1caca280eaac0314444.tar.gz
tcl-8435bb9d68cdb26190ded1caca280eaac0314444.tar.bz2
Bugfix [ae61a67192]. file {stat, type, size} etc. support for built-in special Windows files/devices like CON.
Diffstat (limited to 'win/tclWinPort.h')
-rw-r--r--win/tclWinPort.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/win/tclWinPort.h b/win/tclWinPort.h
index ca6b2bf..b486466 100644
--- a/win/tclWinPort.h
+++ b/win/tclWinPort.h
@@ -360,6 +360,20 @@ typedef DWORD_PTR * PDWORD_PTR;
# define S_IFLNK 0120000 /* Symbolic Link */
#endif
+/*
+ * Windows compilers do not define S_IFBLK. However, Tcl uses it in
+ * GetTypeFromMode to identify blockSpecial devices based on the
+ * value in the statsbuf st_mode field. We have no other way to pass this
+ * from NativeStat on Windows so are forced to define it here.
+ * The definition here is essentially what is seen on Linux and MingW.
+ * XXX - the root problem is Tcl using Unix definitions instead of
+ * abstracting the structure into a platform independent one. Sigh - perhaps
+ * Tcl 9
+ */
+#ifndef S_IFBLK
+# define S_IFBLK (S_IFDIR | S_IFCHR)
+#endif
+
#ifndef S_ISREG
# ifdef S_IFREG
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)