summaryrefslogtreecommitdiffstats
path: root/win/tclWinPort.h
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-04-13 13:37:28 (GMT)
committernijtmans <nijtmans>2010-04-13 13:37:28 (GMT)
commitc06c61b28e8878da81a9b56f34c5570f3f3f747a (patch)
tree76f71209be2c8e9b03c7e2c8ae1cfc7612b3ad78 /win/tclWinPort.h
parentf10d81b895d8ca9d30428aac9884685fb284986a (diff)
downloadtcl-c06c61b28e8878da81a9b56f34c5570f3f3f747a.zip
tcl-c06c61b28e8878da81a9b56f34c5570f3f3f747a.tar.gz
tcl-c06c61b28e8878da81a9b56f34c5570f3f3f747a.tar.bz2
Fix [Patch 2986105]: conditionally defining strcasecmp/strncasecmp
Fix gcc warning: comparison of unsigned expression >= 0 is always true
Diffstat (limited to 'win/tclWinPort.h')
-rw-r--r--win/tclWinPort.h54
1 files changed, 27 insertions, 27 deletions
diff --git a/win/tclWinPort.h b/win/tclWinPort.h
index df76d46..b5edc6e 100644
--- a/win/tclWinPort.h
+++ b/win/tclWinPort.h
@@ -10,7 +10,7 @@
* 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.54 2010/01/22 13:02:50 nijtmans Exp $
+ * RCS: @(#) $Id: tclWinPort.h,v 1.55 2010/04/13 13:37:28 nijtmans Exp $
*/
#ifndef _TCLWINPORT
@@ -42,14 +42,10 @@
*---------------------------------------------------------------------------
*/
-#ifdef __CYGWIN__
-# include <unistd.h>
-# include <wchar.h>
-#else
-# include <io.h>
-#endif
-#include <stdio.h>
+#include <wchar.h>
+#include <io.h>
#include <stdlib.h>
+#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <float.h>
@@ -58,14 +54,18 @@
#include <signal.h>
#include <string.h>
-/*
- * These string functions are not defined with the same names on Windows.
- */
-
-#ifndef __CYGWIN__
-#define wcscasecmp _wcsicmp
-#define strcasecmp stricmp
-#define strncasecmp strnicmp
+#ifdef __CYGWIN__
+# include <unistd.h>
+# ifndef _wcsicmp
+# define _wcsicmp wcscasecmp
+# endif
+#else
+# ifndef strncasecmp
+# define strncasecmp strnicmp
+# endif
+# ifndef strcasecmp
+# define strcasecmp stricmp
+# endif
#endif
/*
@@ -305,7 +305,7 @@
*/
#ifndef S_IFLNK
-#define S_IFLNK 0120000 /* Symbolic Link */
+# define S_IFLNK 0120000 /* Symbolic Link */
#endif
#ifndef S_ISREG
@@ -357,11 +357,11 @@
*/
#ifndef MAXPATH
-#define MAXPATH MAX_PATH
+# define MAXPATH MAX_PATH
#endif /* MAXPATH */
#ifndef MAXPATHLEN
-#define MAXPATHLEN MAXPATH
+# define MAXPATHLEN MAXPATH
#endif /* MAXPATHLEN */
/*
@@ -382,13 +382,13 @@
*/
#if defined(_MSC_VER) || defined(__MINGW32__)
-# define environ _environ
-# define hypot _hypot
-# define exception _exception
-# undef EDEADLOCK
-# if defined(__MINGW32__) && !defined(__MSVCRT__)
+# define environ _environ
+# define hypot _hypot
+# define exception _exception
+# undef EDEADLOCK
+# if defined(__MINGW32__) && !defined(__MSVCRT__)
# define timezone _timezone
-# endif
+# endif
#endif /* _MSC_VER || __MINGW32__ */
/*
@@ -402,8 +402,8 @@
#ifdef __CYGWIN__
/* On Cygwin, the environment is imported from the Cygwin DLL. */
-# define putenv TclCygwinPutenv
-# define timezone _timezone
+# define putenv TclCygwinPutenv
+# define timezone _timezone
#endif /* __CYGWIN__ */