summaryrefslogtreecommitdiffstats
path: root/win/tkWinPort.h
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-04-19 08:23:29 (GMT)
committernijtmans <nijtmans>2010-04-19 08:23:29 (GMT)
commit06697a8234b51338f521bf6cfa9dfbd709fd2ebc (patch)
treecdd48002278e9fde3f52843fad160f0f2df68400 /win/tkWinPort.h
parent1a2421bd5cc9dc551e0a50ed3776489735468c85 (diff)
downloadtk-06697a8234b51338f521bf6cfa9dfbd709fd2ebc.zip
tk-06697a8234b51338f521bf6cfa9dfbd709fd2ebc.tar.gz
tk-06697a8234b51338f521bf6cfa9dfbd709fd2ebc.tar.bz2
Fix [Patch 2986105]: conditionally defining strcasecmp/strncasecmp
Diffstat (limited to 'win/tkWinPort.h')
-rw-r--r--win/tkWinPort.h58
1 files changed, 30 insertions, 28 deletions
diff --git a/win/tkWinPort.h b/win/tkWinPort.h
index cb8def1..31d020d 100644
--- a/win/tkWinPort.h
+++ b/win/tkWinPort.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: tkWinPort.h,v 1.10 2005/09/28 18:31:57 dgp Exp $
+ * RCS: @(#) $Id: tkWinPort.h,v 1.10.4.1 2010/04/19 08:23:31 nijtmans Exp $
*/
#ifndef _WINPORT
@@ -42,19 +42,39 @@
#endif
#include <time.h>
-#ifdef __CYGWIN__
-# define _T(x) L##x
-#else
-# include <tchar.h>
-#endif
#ifdef _MSC_VER
-# define hypot _hypot
+# ifndef hypot
+# define hypot _hypot
+# endif
#endif /* _MSC_VER */
-#ifndef __GNUC__
-# define strncasecmp strnicmp
-# define strcasecmp stricmp
+/*
+ * Pull in the typedef of TCHAR for windows.
+ */
+#if !defined(_TCHAR_DEFINED)
+# include <tchar.h>
+# ifndef _TCHAR_DEFINED
+ /* Borland seems to forget to set this. */
+ typedef _TCHAR TCHAR;
+# define _TCHAR_DEFINED
+# endif
+#endif
+
+#ifdef __CYGWIN__
+# ifndef _vsnprintf
+# define _vsnprintf vsnprintf
+# endif
+# ifndef _wcsicmp
+# define _wcsicmp wcscasecmp
+# endif
+#else
+# ifndef strncasecmp
+# define strncasecmp strnicmp
+# endif
+# ifndef strcasecmp
+# define strcasecmp stricmp
+# endif
#endif
#define NBBY 8
@@ -119,22 +139,4 @@
#define TkpCreateNativeBitmap(display, source) None
#define TkpGetNativeAppBitmap(display, name, w, h) None
-/*
- * Define timezone for gettimeofday.
- */
-
-struct timezone {
- int tz_minuteswest;
- int tz_dsttime;
-};
-
-/*
- * Disabled inclusion of Tcl's private header in hope of discovering we
- * no longer need it.
- *
-#ifndef _TCLINT
-#include <tclInt.h>
-#endif
- */
-
#endif /* _WINPORT */