summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authornijtmans <nijtmans@noemail.net>2010-01-13 06:46:56 (GMT)
committernijtmans <nijtmans@noemail.net>2010-01-13 06:46:56 (GMT)
commit58043ae82cd091b9ef9367e372d2d493ee392cbc (patch)
treeb75b8bc167a7e17a11d9b03e2f9f37e3ff845fde /win
parent89c7aa8b733984578720951c6cb6d356714f669c (diff)
downloadtcl-58043ae82cd091b9ef9367e372d2d493ee392cbc.zip
tcl-58043ae82cd091b9ef9367e372d2d493ee392cbc.tar.gz
tcl-58043ae82cd091b9ef9367e372d2d493ee392cbc.tar.bz2
Fix TCL_LL_MODIFIER for Cygwin
and various other minor CYGWIN compilation problems FossilOrigin-Name: 2be0f4173bb95bdd0859100b31a205998b6152bb
Diffstat (limited to 'win')
-rw-r--r--win/cat.c8
-rw-r--r--win/tclWinConsole.c4
-rw-r--r--win/tclWinFile.c6
-rw-r--r--win/tclWinPipe.c6
-rw-r--r--win/tclWinPort.h30
-rw-r--r--win/tclWinSerial.c18
-rw-r--r--win/tclWinThrd.c4
7 files changed, 38 insertions, 38 deletions
diff --git a/win/cat.c b/win/cat.c
index d1a7338..c91e0d2 100644
--- a/win/cat.c
+++ b/win/cat.c
@@ -8,11 +8,15 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: cat.c,v 1.4 2008/10/16 22:34:19 nijtmans Exp $
+ * RCS: @(#) $Id: cat.c,v 1.5 2010/01/13 06:46:56 nijtmans Exp $
*/
#include <stdio.h>
-#include <io.h>
+#ifdef __CYGWIN__
+# include <unistd.h>
+#else
+# include <io.h>
+#endif
#include <string.h>
int
diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c
index 16ea391..a47165c 100644
--- a/win/tclWinConsole.c
+++ b/win/tclWinConsole.c
@@ -9,13 +9,11 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinConsole.c,v 1.22 2010/01/10 22:58:39 nijtmans Exp $
+ * RCS: @(#) $Id: tclWinConsole.c,v 1.23 2010/01/13 06:46:56 nijtmans Exp $
*/
#include "tclWinInt.h"
-#include <fcntl.h>
-#include <io.h>
#include <sys/stat.h>
/*
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index c9d6e28..f18ca7e 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinFile.c,v 1.101 2009/12/21 23:25:40 nijtmans Exp $
+ * RCS: @(#) $Id: tclWinFile.c,v 1.102 2010/01/13 06:46:56 nijtmans Exp $
*/
/* #define _WIN32_WINNT 0x0500 */
@@ -226,7 +226,7 @@ WinLink(
{
WCHAR tempFileName[MAX_PATH];
TCHAR *tempFilePart;
- int attr;
+ DWORD attr;
/*
* Get the full path referenced by the target.
@@ -347,7 +347,7 @@ WinReadLink(
{
WCHAR tempFileName[MAX_PATH];
TCHAR *tempFilePart;
- int attr;
+ DWORD attr;
/*
* Get the full path referenced by the target.
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 2b00ccf..8357637 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -9,13 +9,11 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinPipe.c,v 1.72 2010/01/10 22:58:40 nijtmans Exp $
+ * RCS: @(#) $Id: tclWinPipe.c,v 1.73 2010/01/13 06:46:56 nijtmans Exp $
*/
#include "tclWinInt.h"
-#include <fcntl.h>
-#include <io.h>
#include <sys/stat.h>
/*
@@ -2740,7 +2738,7 @@ Tcl_PidObjCmd(
return TCL_ERROR;
}
if (objc == 1) {
- wsprintfA(buf, "%lu", (unsigned long) _getpid());
+ wsprintfA(buf, "%lu", (unsigned long) getpid());
Tcl_SetObjResult(interp, Tcl_NewStringObj(buf, -1));
} else {
chan = Tcl_GetChannel(interp, Tcl_GetStringFromObj(objv[1], NULL),
diff --git a/win/tclWinPort.h b/win/tclWinPort.h
index 01e5432..c7e343f 100644
--- a/win/tclWinPort.h
+++ b/win/tclWinPort.h
@@ -10,12 +10,22 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinPort.h,v 1.52 2009/12/21 23:25:41 nijtmans Exp $
+ * RCS: @(#) $Id: tclWinPort.h,v 1.53 2010/01/13 06:46:56 nijtmans Exp $
*/
#ifndef _TCLWINPORT
#define _TCLWINPORT
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+
+/*
+ * Ask for the winsock function typedefs, also.
+ */
+#define INCL_WINSOCK_API_TYPEDEFS 1
+#include <winsock2.h>
+
#ifdef CHECK_UNICODE_CALLS
# define _UNICODE
# define UNICODE
@@ -32,13 +42,17 @@
*---------------------------------------------------------------------------
*/
+#ifdef __CYGWIN__
+# include <unistd.h>
+# include <wchar.h>
+#else
+# include <io.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
-
#include <errno.h>
#include <fcntl.h>
#include <float.h>
-#include <io.h>
#include <malloc.h>
#include <process.h>
#include <signal.h>
@@ -71,16 +85,6 @@
#include <time.h>
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#undef WIN32_LEAN_AND_MEAN
-
-/*
- * Ask for the winsock function typedefs, also.
- */
-#define INCL_WINSOCK_API_TYPEDEFS 1
-#include <winsock2.h>
-
/*
* Define EINPROGRESS in terms of WSAEINPROGRESS.
*/
diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c
index ecefc2e..c3144e3 100644
--- a/win/tclWinSerial.c
+++ b/win/tclWinSerial.c
@@ -11,13 +11,11 @@
*
* Serial functionality implemented by Rolf.Schroedter@dlr.de
*
- * RCS: @(#) $Id: tclWinSerial.c,v 1.40 2010/01/10 22:58:40 nijtmans Exp $
+ * RCS: @(#) $Id: tclWinSerial.c,v 1.41 2010/01/13 06:46:56 nijtmans Exp $
*/
#include "tclWinInt.h"
-#include <fcntl.h>
-#include <io.h>
#include <sys/stat.h>
/*
@@ -1744,16 +1742,16 @@ SerialSetOptionProc(
dcb.XonLim = (WORD) (infoPtr->sysBufRead*1/2);
dcb.XoffLim = (WORD) (infoPtr->sysBufRead*1/4);
- if (strnicmp(value, "NONE", vlen) == 0) {
+ if (strncasecmp(value, "NONE", vlen) == 0) {
/*
* Leave all handshake options disabled.
*/
- } else if (strnicmp(value, "XONXOFF", vlen) == 0) {
+ } else if (strncasecmp(value, "XONXOFF", vlen) == 0) {
dcb.fOutX = dcb.fInX = TRUE;
- } else if (strnicmp(value, "RTSCTS", vlen) == 0) {
+ } else if (strncasecmp(value, "RTSCTS", vlen) == 0) {
dcb.fOutxCtsFlow = TRUE;
dcb.fRtsControl = RTS_CONTROL_HANDSHAKE;
- } else if (strnicmp(value, "DTRDSR", vlen) == 0) {
+ } else if (strncasecmp(value, "DTRDSR", vlen) == 0) {
dcb.fOutxDsrFlow = TRUE;
dcb.fDtrControl = DTR_CONTROL_HANDSHAKE;
} else {
@@ -1863,7 +1861,7 @@ SerialSetOptionProc(
result = TCL_ERROR;
break;
}
- if (strnicmp(argv[i], "DTR", strlen(argv[i])) == 0) {
+ if (strncasecmp(argv[i], "DTR", strlen(argv[i])) == 0) {
if (!EscapeCommFunction(infoPtr->handle,
(DWORD) (flag ? SETDTR : CLRDTR))) {
if (interp != NULL) {
@@ -1872,7 +1870,7 @@ SerialSetOptionProc(
result = TCL_ERROR;
break;
}
- } else if (strnicmp(argv[i], "RTS", strlen(argv[i])) == 0) {
+ } else if (strncasecmp(argv[i], "RTS", strlen(argv[i])) == 0) {
if (!EscapeCommFunction(infoPtr->handle,
(DWORD) (flag ? SETRTS : CLRRTS))) {
if (interp != NULL) {
@@ -1881,7 +1879,7 @@ SerialSetOptionProc(
result = TCL_ERROR;
break;
}
- } else if (strnicmp(argv[i], "BREAK", strlen(argv[i])) == 0) {
+ } else if (strncasecmp(argv[i], "BREAK", strlen(argv[i])) == 0) {
if (!EscapeCommFunction(infoPtr->handle,
(DWORD) (flag ? SETBREAK : CLRBREAK))) {
if (interp != NULL) {
diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c
index 2d483ae..67e7350 100644
--- a/win/tclWinThrd.c
+++ b/win/tclWinThrd.c
@@ -10,13 +10,11 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinThrd.c,v 1.51 2010/01/10 22:58:40 nijtmans Exp $
+ * RCS: @(#) $Id: tclWinThrd.c,v 1.52 2010/01/13 06:46:56 nijtmans Exp $
*/
#include "tclWinInt.h"
-#include <fcntl.h>
-#include <io.h>
#include <sys/stat.h>
/*