diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-05-07 06:33:12 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-05-07 06:33:12 (GMT) |
commit | e40e34cb04d940b132e66ccd21b3018a68ffe3f7 (patch) | |
tree | ce636b6d780ba4a747644cdcc679f3359fe92bce /generic | |
parent | 05859b921e7478bb5202dcc464028b7b25db7a43 (diff) | |
download | tcl-e40e34cb04d940b132e66ccd21b3018a68ffe3f7.zip tcl-e40e34cb04d940b132e66ccd21b3018a68ffe3f7.tar.gz tcl-e40e34cb04d940b132e66ccd21b3018a68ffe3f7.tar.bz2 |
move TCHAR definition for Cygwin from tclUnixPort.h to tclPlatDecls.h,
so it can be used for the Plat* interfaces as well
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclIOSock.c | 2 | ||||
-rw-r--r-- | generic/tclPlatDecls.h | 19 |
2 files changed, 9 insertions, 12 deletions
diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c index 159f3da..1e57cc0 100644 --- a/generic/tclIOSock.c +++ b/generic/tclIOSock.c @@ -84,7 +84,7 @@ TclSockGetPort(interp, string, proto, portPtr) */ #undef TclSockMinimumBuffers -#ifndef _WIN32 +#if !defined(_WIN32) && !defined(__CYGWIN__) # define SOCKET int #endif diff --git a/generic/tclPlatDecls.h b/generic/tclPlatDecls.h index 3be40cb..02191ca 100644 --- a/generic/tclPlatDecls.h +++ b/generic/tclPlatDecls.h @@ -11,19 +11,16 @@ #define _TCLPLATDECLS /* - * Pull in the typedef of TCHAR for windows. + * 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) -# 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__) - /* MSVC++ misses this. */ - typedef _TCHAR TCHAR; +#if (defined(_WIN32) || defined(__CYGWIN__)) && !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. */ |