summaryrefslogtreecommitdiffstats
path: root/generic/tclPlatDecls.h
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-04-22 11:40:31 (GMT)
committernijtmans <nijtmans>2010-04-22 11:40:31 (GMT)
commit4c3a083386d8c35e9a7d32b9f88b3ba9dc9fc9de (patch)
treeb4c7c5b00f25f4e8cf1882d5b5e88eb39f9d3799 /generic/tclPlatDecls.h
parent833ea84043d927c416802983797aa3884a894012 (diff)
downloadtcl-4c3a083386d8c35e9a7d32b9f88b3ba9dc9fc9de.zip
tcl-4c3a083386d8c35e9a7d32b9f88b3ba9dc9fc9de.tar.gz
tcl-4c3a083386d8c35e9a7d32b9f88b3ba9dc9fc9de.tar.bz2
Move TCHAR fallback typedef from tcl.h to tclPlatDecls.h (as suggested by dgp)
Eliminate various unnecessary type casts.
Diffstat (limited to 'generic/tclPlatDecls.h')
-rw-r--r--generic/tclPlatDecls.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/generic/tclPlatDecls.h b/generic/tclPlatDecls.h
index b9117ac..6d44a7e 100644
--- a/generic/tclPlatDecls.h
+++ b/generic/tclPlatDecls.h
@@ -6,7 +6,7 @@
* Copyright (c) 1998-1999 by Scriptics Corporation.
* All rights reserved.
*
- * RCS: @(#) $Id: tclPlatDecls.h,v 1.38 2010/04/15 13:58:44 nijtmans Exp $
+ * RCS: @(#) $Id: tclPlatDecls.h,v 1.39 2010/04/22 11:40:31 nijtmans Exp $
*/
#ifndef _TCLPLATDECLS
@@ -29,6 +29,19 @@
* in the generic/tcl.decls script.
*/
+/*
+ * TCHAR is needed here for win32, so if it is not defined yet do it here.
+ * This way, we don't need to include <tchar.h> just for one define.
+ */
+#if defined(_WIN32) && !defined(_TCHAR_DEFINED)
+# if defined(_UNICODE)
+ typedef wchar_t TCHAR;
+# else
+ typedef char TCHAR;
+# endif
+# define _TCHAR_DEFINED
+#endif
+
/* !BEGIN!: Do not edit below this line. */
/*