summaryrefslogtreecommitdiffstats
path: root/win/tkWinPort.h
diff options
context:
space:
mode:
Diffstat (limited to 'win/tkWinPort.h')
-rw-r--r--win/tkWinPort.h46
1 files changed, 33 insertions, 13 deletions
diff --git a/win/tkWinPort.h b/win/tkWinPort.h
index f991195..9deefce 100644
--- a/win/tkWinPort.h
+++ b/win/tkWinPort.h
@@ -40,19 +40,43 @@
#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
+# if defined(_MSC_VER) && defined(__STDC__)
+ /* VS2005 SP1 misses this. See [Bug #3110161] */
+ typedef _TCHAR TCHAR;
+# 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
@@ -117,8 +141,4 @@
#define TkpCreateNativeBitmap(display, source) None
#define TkpGetNativeAppBitmap(display, name, w, h) None
-#ifndef _TCLINT
-#include <tclInt.h>
-#endif
-
#endif /* _WINPORT */