Tcl Source Code

Check-in [d87557d5c3]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:move TCHAR definition for Cygwin from tclUnixPort.h to tclPlatDecls.h, so it can be used for the Plat* interfaces as well
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: d87557d5c3e8f0fe51af2d6e2108e6688ff14d30
User & Date: jan.nijtmans 2012-05-07 08:21:04
Context
2012-05-10
20:44
[Bug 473946]: special characters not correctly sent check-in: 8a869dadb3 user: jan.nijtmans tags: core-8-5-branch
2012-05-07
08:27
move TCHAR definition for Cygwin from tclUnixPort.h to tclPlatDecls.h, so it can be used for the Pla... check-in: 93f80efb6e user: jan.nijtmans tags: trunk
08:21
move TCHAR definition for Cygwin from tclUnixPort.h to tclPlatDecls.h, so it can be used for the Pla... check-in: d87557d5c3 user: jan.nijtmans tags: core-8-5-branch
06:33
move TCHAR definition for Cygwin from tclUnixPort.h to tclPlatDecls.h, so it can be used for the Pl... check-in: 1a117d1880 user: jan.nijtmans tags: core-8-4-branch
2012-05-03
21:01
don't try to run the cpuid test when cpuid is not available check-in: 9bbb7cfbc5 user: jan.nijtmans tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclIOSock.c.

79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
 *	Sets SO_SNDBUF and SO_RCVBUF sizes.
 *
 *----------------------------------------------------------------------
 */

#undef TclSockMinimumBuffers
#if !defined(_WIN32) && !defined(__CYGWIN__)
#   define SOCKET size_t
#endif

int
TclSockMinimumBuffers(
    void *sock,			/* Socket file descriptor */
    int size)			/* Minimum buffer size */
{






|







79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
 *	Sets SO_SNDBUF and SO_RCVBUF sizes.
 *
 *----------------------------------------------------------------------
 */

#undef TclSockMinimumBuffers
#if !defined(_WIN32) && !defined(__CYGWIN__)
#   define SOCKET int
#endif

int
TclSockMinimumBuffers(
    void *sock,			/* Socket file descriptor */
    int size)			/* Minimum buffer size */
{

Changes to generic/tclPlatDecls.h.

18
19
20
21
22
23
24
25

26
27
28
29
30
31
32
33
34
35
36
37

38
39
40
41
42
43
44
#      define TCL_STORAGE_CLASS
#   else
#      define TCL_STORAGE_CLASS DLLIMPORT
#   endif
#endif

/*
 *  Pull in the typedef of TCHAR for windows.

 */
#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__)
	/* VS2005 SP1 misses this. See [Bug #3110161] */
	typedef _TCHAR TCHAR;
#   endif

#endif

/* !BEGIN!: Do not edit below this line. */

/*
 * Exported function declarations:
 */






|
>

|
<
|
<
|
<
|
<
<
|

>







18
19
20
21
22
23
24
25
26
27
28

29

30

31


32
33
34
35
36
37
38
39
40
41
#      define TCL_STORAGE_CLASS
#   else
#      define TCL_STORAGE_CLASS DLLIMPORT
#   endif
#endif

/*
 * 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(__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. */

/*
 * Exported function declarations:
 */

Changes to unix/tclUnixPort.h.

79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
...
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
#   define DWORD unsigned int
#   define CP_UTF8 65001
#   define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004
#   define HANDLE void *
#   define HINSTANCE void *
#   define SOCKET unsigned int
#   define WSAEWOULDBLOCK 10035
    typedef char TCHAR;
    DLLIMPORT extern __stdcall int GetModuleHandleExW(unsigned int, const char *, void *);
    DLLIMPORT extern __stdcall int GetModuleFileNameW(void *, const char *, int);
    DLLIMPORT extern __stdcall int WideCharToMultiByte(int, int, const char *, int,
	    const char *, int, const char *, const char *);

    DLLIMPORT extern int cygwin_conv_to_full_posix_path(const char *, char *);
#   define USE_PUTENV 1
................................................................................
 * The following macros and declaration wrap the C runtime library
 * functions.
 */

#define TclpExit		exit

#ifdef TCL_THREADS
EXTERN struct tm *     	TclpLocaltime(CONST time_t *);
EXTERN struct tm *     	TclpGmtime(CONST time_t *);
/* #define localtime(x)	TclpLocaltime(x)
 * #define gmtime(x)	TclpGmtime(x)    */
#   undef inet_ntoa
#   define inet_ntoa(x)	TclpInetNtoa(x)
#   ifdef HAVE_PTHREAD_ATTR_GET_NP
#	define TclpPthreadGetAttrs	pthread_attr_get_np
#	ifdef ATTRGETNP_NOT_DECLARED






<







 







|
|







79
80
81
82
83
84
85

86
87
88
89
90
91
92
...
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
#   define DWORD unsigned int
#   define CP_UTF8 65001
#   define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004
#   define HANDLE void *
#   define HINSTANCE void *
#   define SOCKET unsigned int
#   define WSAEWOULDBLOCK 10035

    DLLIMPORT extern __stdcall int GetModuleHandleExW(unsigned int, const char *, void *);
    DLLIMPORT extern __stdcall int GetModuleFileNameW(void *, const char *, int);
    DLLIMPORT extern __stdcall int WideCharToMultiByte(int, int, const char *, int,
	    const char *, int, const char *, const char *);

    DLLIMPORT extern int cygwin_conv_to_full_posix_path(const char *, char *);
#   define USE_PUTENV 1
................................................................................
 * The following macros and declaration wrap the C runtime library
 * functions.
 */

#define TclpExit		exit

#ifdef TCL_THREADS
EXTERN struct tm *TclpLocaltime(CONST time_t *);
EXTERN struct tm *TclpGmtime(CONST time_t *);
/* #define localtime(x)	TclpLocaltime(x)
 * #define gmtime(x)	TclpGmtime(x)    */
#   undef inet_ntoa
#   define inet_ntoa(x)	TclpInetNtoa(x)
#   ifdef HAVE_PTHREAD_ATTR_GET_NP
#	define TclpPthreadGetAttrs	pthread_attr_get_np
#	ifdef ATTRGETNP_NOT_DECLARED