summaryrefslogtreecommitdiffstats
path: root/win/tkWinPort.h
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-04-08 14:06:20 (GMT)
committernijtmans <nijtmans>2010-04-08 14:06:20 (GMT)
commit843ef125db98bc3a762319cc94e9ce8de0881cef (patch)
treeb7fcf9bd3a46ca59ea6692d02cb7cacc14303358 /win/tkWinPort.h
parent3b668a10084cd1d859858124bfa1799162453d08 (diff)
downloadtk-843ef125db98bc3a762319cc94e9ce8de0881cef.zip
tk-843ef125db98bc3a762319cc94e9ce8de0881cef.tar.gz
tk-843ef125db98bc3a762319cc94e9ce8de0881cef.tar.bz2
Add <wchar.h> to tkWinPort.h, and
remove some earlier CYGWIN-related hacks which then are no longer necessary.
Diffstat (limited to 'win/tkWinPort.h')
-rw-r--r--win/tkWinPort.h48
1 files changed, 23 insertions, 25 deletions
diff --git a/win/tkWinPort.h b/win/tkWinPort.h
index 3a99c43..a596de1 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.13 2010/01/22 14:17:53 nijtmans Exp $
+ * RCS: @(#) $Id: tkWinPort.h,v 1.14 2010/04/08 14:06:20 nijtmans Exp $
*/
#ifndef _WINPORT
@@ -22,20 +22,16 @@
#include <X11/Xatom.h>
#include <X11/Xutil.h>
-#include <malloc.h>
+#include <wchar.h>
+#include <io.h>
+#include <stdlib.h>
#include <errno.h>
+#include <fcntl.h>
+#include <malloc.h>
#include <ctype.h>
#include <math.h>
-#include <stdlib.h>
#include <string.h>
#include <limits.h>
-#include <fcntl.h>
-#ifdef __CYGWIN__
-# include <unistd.h>
-# include <wchar.h>
-#else
-# include <io.h>
-#endif
/*
* Need to block out this include for building extensions with MetroWerks
@@ -47,29 +43,31 @@
#endif
#include <time.h>
-#ifdef __CYGWIN__
-# define _T(x) L##x
-#else
-# include <tchar.h>
-#endif
#ifdef _MSC_VER
# define hypot _hypot
#endif /* _MSC_VER */
-#ifdef __CYGWIN__
-# ifdef _UNICODE
-# define _tcsrchr wcsrchr
-# else
-# define _tcsrchr strrchr
-
+/*
+ * 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
-#else
-# define wcscasecmp _wcsicmp
-# define strncasecmp strnicmp
-# define strcasecmp stricmp
#endif
+#ifdef __CYGWIN__
+#define _vsnprintf vsnprintf
+#define _wcsicmp wcscasecmp
+#endif
+
+#define strncasecmp strnicmp
+#define strcasecmp stricmp
+
#define NBBY 8
#ifndef OPEN_MAX