/[dtapublic]/projs/trunk/shared_source/c_tcl_base_7_5_w_mods/tclwinport.h
ViewVC logotype

Diff of /projs/trunk/shared_source/c_tcl_base_7_5_w_mods/tclwinport.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 67 by dashley, Mon Oct 31 00:57:34 2016 UTC revision 71 by dashley, Sat Nov 5 11:07:06 2016 UTC
# Line 1  Line 1 
1  /* $Header$ */  /* $Header$ */
2  /*  /*
3   * tclWinPort.h --   * tclWinPort.h --
4   *   *
5   *      This header file handles porting issues that occur because of   *      This header file handles porting issues that occur because of
6   *      differences between Windows and Unix. It should be the only   *      differences between Windows and Unix. It should be the only
7   *      file that contains #ifdefs to handle different flavors of OS.   *      file that contains #ifdefs to handle different flavors of OS.
8   *   *
9   * Copyright (c) 1994-1997 Sun Microsystems, Inc.   * Copyright (c) 1994-1997 Sun Microsystems, Inc.
10   *   *
11   * See the file "license.terms" for information on usage and redistribution   * See the file "license.terms" for information on usage and redistribution
12   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13   *   *
14   * RCS: @(#) $Id: tclwinport.h,v 1.1.1.1 2001/06/13 04:49:51 dtashley Exp $   * RCS: @(#) $Id: tclwinport.h,v 1.1.1.1 2001/06/13 04:49:51 dtashley Exp $
15   */   */
16    
17  #ifndef _TCLWINPORT  #ifndef _TCLWINPORT
18  #define _TCLWINPORT  #define _TCLWINPORT
19    
20  #ifndef _TCLINT  #ifndef _TCLINT
21  #   include "tclInt.h"  #   include "tclInt.h"
22  #endif  #endif
23    
24  #ifdef CHECK_UNICODE_CALLS  #ifdef CHECK_UNICODE_CALLS
25    
26  #define _UNICODE  #define _UNICODE
27  #define UNICODE  #define UNICODE
28    
29  #define __TCHAR_DEFINED  #define __TCHAR_DEFINED
30  typedef float *_TCHAR;  typedef float *_TCHAR;
31    
32  #define _TCHAR_DEFINED  #define _TCHAR_DEFINED
33  typedef float *TCHAR;  typedef float *TCHAR;
34    
35  #endif  #endif
36    
37  /*  /*
38   *---------------------------------------------------------------------------   *---------------------------------------------------------------------------
39   * The following sets of #includes and #ifdefs are required to get Tcl to   * The following sets of #includes and #ifdefs are required to get Tcl to
40   * compile under the windows compilers.   * compile under the windows compilers.
41   *---------------------------------------------------------------------------   *---------------------------------------------------------------------------
42   */   */
43    
44  #include <stdio.h>  #include <stdio.h>
45  #include <stdlib.h>  #include <stdlib.h>
46    
47  #include <direct.h>  #include <direct.h>
48  #include <errno.h>  #include <errno.h>
49  #include <fcntl.h>  #include <fcntl.h>
50  #include <float.h>  #include <float.h>
51  #include <io.h>  #include <io.h>
52  #include <malloc.h>  #include <malloc.h>
53  #include <process.h>  #include <process.h>
54  #include <signal.h>  #include <signal.h>
55  #include <string.h>  #include <string.h>
56    
57  /*  /*
58   * Need to block out these includes for building extensions with MetroWerks   * Need to block out these includes for building extensions with MetroWerks
59   * compiler for Win32.   * compiler for Win32.
60   */   */
61    
62  #ifndef __MWERKS__  #ifndef __MWERKS__
63  #include <sys/stat.h>  #include <sys/stat.h>
64  #include <sys/timeb.h>  #include <sys/timeb.h>
65  #include <sys/utime.h>  #include <sys/utime.h>
66  #endif  #endif
67    
68  #include <tchar.h>  #include <tchar.h>
69  #include <time.h>  #include <time.h>
70  #include <winsock2.h>  #include <winsock2.h>
71    
72  #define WIN32_LEAN_AND_MEAN  #define WIN32_LEAN_AND_MEAN
73  #include <windows.h>  #include <windows.h>
74  #undef WIN32_LEAN_AND_MEAN  #undef WIN32_LEAN_AND_MEAN
75    
76  #ifdef BUILD_tcl  #ifdef BUILD_tcl
77  # undef TCL_STORAGE_CLASS  # undef TCL_STORAGE_CLASS
78  # define TCL_STORAGE_CLASS DLLEXPORT  # define TCL_STORAGE_CLASS DLLEXPORT
79  #endif  #endif
80    
81  /*  /*
82   * Define EINPROGRESS in terms of WSAEINPROGRESS.   * Define EINPROGRESS in terms of WSAEINPROGRESS.
83   */   */
84    
85  #ifndef EINPROGRESS  #ifndef EINPROGRESS
86  #define EINPROGRESS WSAEINPROGRESS  #define EINPROGRESS WSAEINPROGRESS
87  #endif  #endif
88    
89  /*  /*
90   * If ENOTSUP is not defined, define it to a value that will never occur.   * If ENOTSUP is not defined, define it to a value that will never occur.
91   */   */
92    
93  #ifndef ENOTSUP  #ifndef ENOTSUP
94  #define ENOTSUP         -1030507  #define ENOTSUP         -1030507
95  #endif  #endif
96    
97  /*  /*
98   * The following defines redefine the Windows Socket errors as   * The following defines redefine the Windows Socket errors as
99   * BSD errors so Tcl_PosixError can do the right thing.   * BSD errors so Tcl_PosixError can do the right thing.
100   */   */
101    
102  #ifndef EWOULDBLOCK  #ifndef EWOULDBLOCK
103  #define EWOULDBLOCK             EAGAIN  #define EWOULDBLOCK             EAGAIN
104  #endif  #endif
105  #ifndef EALREADY  #ifndef EALREADY
106  #define EALREADY        149     /* operation already in progress */  #define EALREADY        149     /* operation already in progress */
107  #endif  #endif
108  #ifndef ENOTSOCK  #ifndef ENOTSOCK
109  #define ENOTSOCK        95      /* Socket operation on non-socket */  #define ENOTSOCK        95      /* Socket operation on non-socket */
110  #endif  #endif
111  #ifndef EDESTADDRREQ  #ifndef EDESTADDRREQ
112  #define EDESTADDRREQ    96      /* Destination address required */  #define EDESTADDRREQ    96      /* Destination address required */
113  #endif  #endif
114  #ifndef EMSGSIZE  #ifndef EMSGSIZE
115  #define EMSGSIZE        97      /* Message too long */  #define EMSGSIZE        97      /* Message too long */
116  #endif  #endif
117  #ifndef EPROTOTYPE  #ifndef EPROTOTYPE
118  #define EPROTOTYPE      98      /* Protocol wrong type for socket */  #define EPROTOTYPE      98      /* Protocol wrong type for socket */
119  #endif  #endif
120  #ifndef ENOPROTOOPT  #ifndef ENOPROTOOPT
121  #define ENOPROTOOPT     99      /* Protocol not available */  #define ENOPROTOOPT     99      /* Protocol not available */
122  #endif  #endif
123  #ifndef EPROTONOSUPPORT  #ifndef EPROTONOSUPPORT
124  #define EPROTONOSUPPORT 120     /* Protocol not supported */  #define EPROTONOSUPPORT 120     /* Protocol not supported */
125  #endif  #endif
126  #ifndef ESOCKTNOSUPPORT  #ifndef ESOCKTNOSUPPORT
127  #define ESOCKTNOSUPPORT 121     /* Socket type not supported */  #define ESOCKTNOSUPPORT 121     /* Socket type not supported */
128  #endif  #endif
129  #ifndef EOPNOTSUPP  #ifndef EOPNOTSUPP
130  #define EOPNOTSUPP      122     /* Operation not supported on socket */  #define EOPNOTSUPP      122     /* Operation not supported on socket */
131  #endif  #endif
132  #ifndef EPFNOSUPPORT  #ifndef EPFNOSUPPORT
133  #define EPFNOSUPPORT    123     /* Protocol family not supported */  #define EPFNOSUPPORT    123     /* Protocol family not supported */
134  #endif  #endif
135  #ifndef EAFNOSUPPORT  #ifndef EAFNOSUPPORT
136  #define EAFNOSUPPORT    124     /* Address family not supported */  #define EAFNOSUPPORT    124     /* Address family not supported */
137  #endif  #endif
138  #ifndef EADDRINUSE  #ifndef EADDRINUSE
139  #define EADDRINUSE      125     /* Address already in use */  #define EADDRINUSE      125     /* Address already in use */
140  #endif  #endif
141  #ifndef EADDRNOTAVAIL  #ifndef EADDRNOTAVAIL
142  #define EADDRNOTAVAIL   126     /* Can't assign requested address */  #define EADDRNOTAVAIL   126     /* Can't assign requested address */
143  #endif  #endif
144  #ifndef ENETDOWN  #ifndef ENETDOWN
145  #define ENETDOWN        127     /* Network is down */  #define ENETDOWN        127     /* Network is down */
146  #endif  #endif
147  #ifndef ENETUNREACH  #ifndef ENETUNREACH
148  #define ENETUNREACH     128     /* Network is unreachable */  #define ENETUNREACH     128     /* Network is unreachable */
149  #endif  #endif
150  #ifndef ENETRESET  #ifndef ENETRESET
151  #define ENETRESET       129     /* Network dropped connection on reset */  #define ENETRESET       129     /* Network dropped connection on reset */
152  #endif  #endif
153  #ifndef ECONNABORTED  #ifndef ECONNABORTED
154  #define ECONNABORTED    130     /* Software caused connection abort */  #define ECONNABORTED    130     /* Software caused connection abort */
155  #endif  #endif
156  #ifndef ECONNRESET  #ifndef ECONNRESET
157  #define ECONNRESET      131     /* Connection reset by peer */  #define ECONNRESET      131     /* Connection reset by peer */
158  #endif  #endif
159  #ifndef ENOBUFS  #ifndef ENOBUFS
160  #define ENOBUFS         132     /* No buffer space available */  #define ENOBUFS         132     /* No buffer space available */
161  #endif  #endif
162  #ifndef EISCONN  #ifndef EISCONN
163  #define EISCONN         133     /* Socket is already connected */  #define EISCONN         133     /* Socket is already connected */
164  #endif  #endif
165  #ifndef ENOTCONN  #ifndef ENOTCONN
166  #define ENOTCONN        134     /* Socket is not connected */  #define ENOTCONN        134     /* Socket is not connected */
167  #endif  #endif
168  #ifndef ESHUTDOWN  #ifndef ESHUTDOWN
169  #define ESHUTDOWN       143     /* Can't send after socket shutdown */  #define ESHUTDOWN       143     /* Can't send after socket shutdown */
170  #endif  #endif
171  #ifndef ETOOMANYREFS  #ifndef ETOOMANYREFS
172  #define ETOOMANYREFS    144     /* Too many references: can't splice */  #define ETOOMANYREFS    144     /* Too many references: can't splice */
173  #endif  #endif
174  #ifndef ETIMEDOUT  #ifndef ETIMEDOUT
175  #define ETIMEDOUT       145     /* Connection timed out */  #define ETIMEDOUT       145     /* Connection timed out */
176  #endif  #endif
177  #ifndef ECONNREFUSED  #ifndef ECONNREFUSED
178  #define ECONNREFUSED    146     /* Connection refused */  #define ECONNREFUSED    146     /* Connection refused */
179  #endif  #endif
180  #ifndef ELOOP  #ifndef ELOOP
181  #define ELOOP           90      /* Symbolic link loop */  #define ELOOP           90      /* Symbolic link loop */
182  #endif  #endif
183  #ifndef EHOSTDOWN  #ifndef EHOSTDOWN
184  #define EHOSTDOWN       147     /* Host is down */  #define EHOSTDOWN       147     /* Host is down */
185  #endif  #endif
186  #ifndef EHOSTUNREACH  #ifndef EHOSTUNREACH
187  #define EHOSTUNREACH    148     /* No route to host */  #define EHOSTUNREACH    148     /* No route to host */
188  #endif  #endif
189  #ifndef ENOTEMPTY  #ifndef ENOTEMPTY
190  #define ENOTEMPTY       93      /* directory not empty */  #define ENOTEMPTY       93      /* directory not empty */
191  #endif  #endif
192  #ifndef EUSERS  #ifndef EUSERS
193  #define EUSERS          94      /* Too many users (for UFS) */  #define EUSERS          94      /* Too many users (for UFS) */
194  #endif  #endif
195  #ifndef EDQUOT  #ifndef EDQUOT
196  #define EDQUOT          49      /* Disc quota exceeded */  #define EDQUOT          49      /* Disc quota exceeded */
197  #endif  #endif
198  #ifndef ESTALE  #ifndef ESTALE
199  #define ESTALE          151     /* Stale NFS file handle */  #define ESTALE          151     /* Stale NFS file handle */
200  #endif  #endif
201  #ifndef EREMOTE  #ifndef EREMOTE
202  #define EREMOTE         66      /* The object is remote */  #define EREMOTE         66      /* The object is remote */
203  #endif  #endif
204    
205  /*  /*
206   * Supply definitions for macros to query wait status, if not already   * Supply definitions for macros to query wait status, if not already
207   * defined in header files above.   * defined in header files above.
208   */   */
209    
210  #if TCL_UNION_WAIT  #if TCL_UNION_WAIT
211  #   define WAIT_STATUS_TYPE union wait  #   define WAIT_STATUS_TYPE union wait
212  #else  #else
213  #   define WAIT_STATUS_TYPE int  #   define WAIT_STATUS_TYPE int
214  #endif  #endif
215    
216  #ifndef WIFEXITED  #ifndef WIFEXITED
217  #   define WIFEXITED(stat)  (((*((int *) &(stat))) & 0xff) == 0)  #   define WIFEXITED(stat)  (((*((int *) &(stat))) & 0xff) == 0)
218  #endif  #endif
219    
220  #ifndef WEXITSTATUS  #ifndef WEXITSTATUS
221  #   define WEXITSTATUS(stat) (((*((int *) &(stat))) >> 8) & 0xff)  #   define WEXITSTATUS(stat) (((*((int *) &(stat))) >> 8) & 0xff)
222  #endif  #endif
223    
224  #ifndef WIFSIGNALED  #ifndef WIFSIGNALED
225  #   define WIFSIGNALED(stat) (((*((int *) &(stat)))) && ((*((int *) &(stat))) == ((*((int *) &(stat))) & 0x00ff)))  #   define WIFSIGNALED(stat) (((*((int *) &(stat)))) && ((*((int *) &(stat))) == ((*((int *) &(stat))) & 0x00ff)))
226  #endif  #endif
227    
228  #ifndef WTERMSIG  #ifndef WTERMSIG
229  #   define WTERMSIG(stat)    ((*((int *) &(stat))) & 0x7f)  #   define WTERMSIG(stat)    ((*((int *) &(stat))) & 0x7f)
230  #endif  #endif
231    
232  #ifndef WIFSTOPPED  #ifndef WIFSTOPPED
233  #   define WIFSTOPPED(stat)  (((*((int *) &(stat))) & 0xff) == 0177)  #   define WIFSTOPPED(stat)  (((*((int *) &(stat))) & 0xff) == 0177)
234  #endif  #endif
235    
236  #ifndef WSTOPSIG  #ifndef WSTOPSIG
237  #   define WSTOPSIG(stat)    (((*((int *) &(stat))) >> 8) & 0xff)  #   define WSTOPSIG(stat)    (((*((int *) &(stat))) >> 8) & 0xff)
238  #endif  #endif
239    
240  /*  /*
241   * Define constants for waitpid() system call if they aren't defined   * Define constants for waitpid() system call if they aren't defined
242   * by a system header file.   * by a system header file.
243   */   */
244    
245  #ifndef WNOHANG  #ifndef WNOHANG
246  #   define WNOHANG 1  #   define WNOHANG 1
247  #endif  #endif
248  #ifndef WUNTRACED  #ifndef WUNTRACED
249  #   define WUNTRACED 2  #   define WUNTRACED 2
250  #endif  #endif
251    
252  /*  /*
253   * Define access mode constants if they aren't already defined.   * Define access mode constants if they aren't already defined.
254   */   */
255    
256  #ifndef F_OK  #ifndef F_OK
257  #    define F_OK 00  #    define F_OK 00
258  #endif  #endif
259  #ifndef X_OK  #ifndef X_OK
260  #    define X_OK 01  #    define X_OK 01
261  #endif  #endif
262  #ifndef W_OK  #ifndef W_OK
263  #    define W_OK 02  #    define W_OK 02
264  #endif  #endif
265  #ifndef R_OK  #ifndef R_OK
266  #    define R_OK 04  #    define R_OK 04
267  #endif  #endif
268    
269  /*  /*
270   * Define macros to query file type bits, if they're not already   * Define macros to query file type bits, if they're not already
271   * defined.   * defined.
272   */   */
273    
274  #ifndef S_ISREG  #ifndef S_ISREG
275  #   ifdef S_IFREG  #   ifdef S_IFREG
276  #       define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)  #       define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
277  #   else  #   else
278  #       define S_ISREG(m) 0  #       define S_ISREG(m) 0
279  #   endif  #   endif
280  # endif  # endif
281  #ifndef S_ISDIR  #ifndef S_ISDIR
282  #   ifdef S_IFDIR  #   ifdef S_IFDIR
283  #       define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)  #       define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
284  #   else  #   else
285  #       define S_ISDIR(m) 0  #       define S_ISDIR(m) 0
286  #   endif  #   endif
287  # endif  # endif
288  #ifndef S_ISCHR  #ifndef S_ISCHR
289  #   ifdef S_IFCHR  #   ifdef S_IFCHR
290  #       define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)  #       define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
291  #   else  #   else
292  #       define S_ISCHR(m) 0  #       define S_ISCHR(m) 0
293  #   endif  #   endif
294  # endif  # endif
295  #ifndef S_ISBLK  #ifndef S_ISBLK
296  #   ifdef S_IFBLK  #   ifdef S_IFBLK
297  #       define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)  #       define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
298  #   else  #   else
299  #       define S_ISBLK(m) 0  #       define S_ISBLK(m) 0
300  #   endif  #   endif
301  # endif  # endif
302  #ifndef S_ISFIFO  #ifndef S_ISFIFO
303  #   ifdef S_IFIFO  #   ifdef S_IFIFO
304  #       define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)  #       define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
305  #   else  #   else
306  #       define S_ISFIFO(m) 0  #       define S_ISFIFO(m) 0
307  #   endif  #   endif
308  # endif  # endif
309    
310  /*  /*
311   * Define MAXPATHLEN in terms of MAXPATH if available   * Define MAXPATHLEN in terms of MAXPATH if available
312   */   */
313    
314  #ifndef MAXPATH  #ifndef MAXPATH
315  #define MAXPATH MAX_PATH  #define MAXPATH MAX_PATH
316  #endif /* MAXPATH */  #endif /* MAXPATH */
317    
318  #ifndef MAXPATHLEN  #ifndef MAXPATHLEN
319  #define MAXPATHLEN MAXPATH  #define MAXPATHLEN MAXPATH
320  #endif /* MAXPATHLEN */  #endif /* MAXPATHLEN */
321    
322  /*  /*
323   * Define pid_t and uid_t if they're not already defined.   * Define pid_t and uid_t if they're not already defined.
324   */   */
325    
326  #if ! TCL_PID_T  #if ! TCL_PID_T
327  #   define pid_t int  #   define pid_t int
328  #endif  #endif
329  #if ! TCL_UID_T  #if ! TCL_UID_T
330  #   define uid_t int  #   define uid_t int
331  #endif  #endif
332    
333  /*  /*
334   * Visual C++ has some odd names for common functions, so we need to   * Visual C++ has some odd names for common functions, so we need to
335   * define a few macros to handle them.  Also, it defines EDEADLOCK and   * define a few macros to handle them.  Also, it defines EDEADLOCK and
336   * EDEADLK as the same value, which confuses Tcl_ErrnoId().   * EDEADLK as the same value, which confuses Tcl_ErrnoId().
337   */   */
338    
339  #if defined(_MSC_VER) || defined(__MINGW32__)  #if defined(_MSC_VER) || defined(__MINGW32__)
340  #    define environ _environ  #    define environ _environ
341  #    define hypot _hypot  #    define hypot _hypot
342  #    define exception _exception  #    define exception _exception
343  #    undef EDEADLOCK  #    undef EDEADLOCK
344  #    if defined(__MINGW32__) && !defined(__MSVCRT__)  #    if defined(__MINGW32__) && !defined(__MSVCRT__)
345  #       define timezone _timezone  #       define timezone _timezone
346  #    endif  #    endif
347  #endif /* _MSC_VER || __MINGW32__ */  #endif /* _MSC_VER || __MINGW32__ */
348    
349  /*  /*
350   *---------------------------------------------------------------------------   *---------------------------------------------------------------------------
351   * The following macros and declarations represent the interface between   * The following macros and declarations represent the interface between
352   * generic and windows-specific parts of Tcl.  Some of the macros may   * generic and windows-specific parts of Tcl.  Some of the macros may
353   * override functions declared in tclInt.h.   * override functions declared in tclInt.h.
354   *---------------------------------------------------------------------------   *---------------------------------------------------------------------------
355   */   */
356    
357  /*  /*
358   * The default platform eol translation on Windows is TCL_TRANSLATE_CRLF:   * The default platform eol translation on Windows is TCL_TRANSLATE_CRLF:
359   */   */
360    
361  #define TCL_PLATFORM_TRANSLATION        TCL_TRANSLATE_CRLF  #define TCL_PLATFORM_TRANSLATION        TCL_TRANSLATE_CRLF
362    
363  /*  /*
364   * Declare dynamic loading extension macro.   * Declare dynamic loading extension macro.
365   */   */
366    
367  #define TCL_SHLIB_EXT ".dll"  #define TCL_SHLIB_EXT ".dll"
368    
369  /*  /*
370   * The following define ensures that we use the native putenv   * The following define ensures that we use the native putenv
371   * implementation to modify the environment array.  This keeps   * implementation to modify the environment array.  This keeps
372   * the C level environment in synch with the system level environment.   * the C level environment in synch with the system level environment.
373   */   */
374    
375  #define USE_PUTENV      1  #define USE_PUTENV      1
376    
377  /*  /*
378   * The following defines wrap the system memory allocation routines for   * The following defines wrap the system memory allocation routines for
379   * use by tclAlloc.c.   * use by tclAlloc.c.
380   */   */
381    
382  #define TclpSysAlloc(size, isBin)       ((void*)HeapAlloc(GetProcessHeap(), \  #define TclpSysAlloc(size, isBin)       ((void*)HeapAlloc(GetProcessHeap(), \
383                                              (DWORD)0, (DWORD)size))                                              (DWORD)0, (DWORD)size))
384  #define TclpSysFree(ptr)                (HeapFree(GetProcessHeap(), \  #define TclpSysFree(ptr)                (HeapFree(GetProcessHeap(), \
385                                              (DWORD)0, (HGLOBAL)ptr))                                              (DWORD)0, (HGLOBAL)ptr))
386  #define TclpSysRealloc(ptr, size)       ((void*)HeapReAlloc(GetProcessHeap(), \  #define TclpSysRealloc(ptr, size)       ((void*)HeapReAlloc(GetProcessHeap(), \
387                                              (DWORD)0, (LPVOID)ptr, (DWORD)size))                                              (DWORD)0, (LPVOID)ptr, (DWORD)size))
388    
389  /*  /*
390   * The following defines map from standard socket names to our internal   * The following defines map from standard socket names to our internal
391   * wrappers that redirect through the winSock function table (see the   * wrappers that redirect through the winSock function table (see the
392   * file tclWinSock.c).   * file tclWinSock.c).
393   */   */
394    
395  #define getservbyname   TclWinGetServByName  #define getservbyname   TclWinGetServByName
396  #define getsockopt      TclWinGetSockOpt  #define getsockopt      TclWinGetSockOpt
397  #define ntohs           TclWinNToHS  #define ntohs           TclWinNToHS
398  #define setsockopt      TclWinSetSockOpt  #define setsockopt      TclWinSetSockOpt
399    
400  /*  /*
401   * The following macros have trivial definitions, allowing generic code to   * The following macros have trivial definitions, allowing generic code to
402   * address platform-specific issues.   * address platform-specific issues.
403   */   */
404    
405  #define TclpReleaseFile(file)   ckfree((char *) file)  #define TclpReleaseFile(file)   ckfree((char *) file)
406    
407  /*  /*
408   * The following macros and declarations wrap the C runtime library   * The following macros and declarations wrap the C runtime library
409   * functions.   * functions.
410   */   */
411    
412  #define TclpExit                exit  #define TclpExit                exit
413  #define TclpLstat               TclpStat  #define TclpLstat               TclpStat
414    
415  /*  /*
416   * Declarations for Windows-only functions.   * Declarations for Windows-only functions.
417   */   */
418    
419  EXTERN Tcl_Channel  TclWinOpenSerialChannel _ANSI_ARGS_((HANDLE handle,  EXTERN Tcl_Channel  TclWinOpenSerialChannel _ANSI_ARGS_((HANDLE handle,
420                          char *channelName, int permissions));                          char *channelName, int permissions));
421                                                                                    
422  EXTERN Tcl_Channel  TclWinOpenConsoleChannel _ANSI_ARGS_((HANDLE handle,  EXTERN Tcl_Channel  TclWinOpenConsoleChannel _ANSI_ARGS_((HANDLE handle,
423                          char *channelName, int permissions));                          char *channelName, int permissions));
424    
425  EXTERN Tcl_Channel  TclWinOpenFileChannel _ANSI_ARGS_((HANDLE handle,  EXTERN Tcl_Channel  TclWinOpenFileChannel _ANSI_ARGS_((HANDLE handle,
426                          char *channelName, int permissions, int appendMode));                          char *channelName, int permissions, int appendMode));
427    
428  EXTERN TclFile TclWinMakeFile _ANSI_ARGS_((HANDLE handle));  EXTERN TclFile TclWinMakeFile _ANSI_ARGS_((HANDLE handle));
429    
430  /*  /*
431   * Platform specific mutex definition used by memory allocators.   * Platform specific mutex definition used by memory allocators.
432   * These mutexes are statically allocated and explicitly initialized.   * These mutexes are statically allocated and explicitly initialized.
433   * Most modules do not use this, but instead use Tcl_Mutex types and   * Most modules do not use this, but instead use Tcl_Mutex types and
434   * Tcl_MutexLock and Tcl_MutexUnlock that are self-initializing.   * Tcl_MutexLock and Tcl_MutexUnlock that are self-initializing.
435   */   */
436    
437  #ifdef TCL_THREADS  #ifdef TCL_THREADS
438  typedef CRITICAL_SECTION TclpMutex;  typedef CRITICAL_SECTION TclpMutex;
439  EXTERN void     TclpMutexInit _ANSI_ARGS_((TclpMutex *mPtr));  EXTERN void     TclpMutexInit _ANSI_ARGS_((TclpMutex *mPtr));
440  EXTERN void     TclpMutexLock _ANSI_ARGS_((TclpMutex *mPtr));  EXTERN void     TclpMutexLock _ANSI_ARGS_((TclpMutex *mPtr));
441  EXTERN void     TclpMutexUnlock _ANSI_ARGS_((TclpMutex *mPtr));  EXTERN void     TclpMutexUnlock _ANSI_ARGS_((TclpMutex *mPtr));
442  #else  #else
443  typedef int TclpMutex;  typedef int TclpMutex;
444  #define TclpMutexInit(a)  #define TclpMutexInit(a)
445  #define TclpMutexLock(a)  #define TclpMutexLock(a)
446  #define TclpMutexUnlock(a)  #define TclpMutexUnlock(a)
447  #endif /* TCL_THREADS */  #endif /* TCL_THREADS */
448    
449  #include "tclPlatDecls.h"  #include "tclPlatDecls.h"
450  #include "tclIntPlatDecls.h"  #include "tclIntPlatDecls.h"
451    
452  # undef TCL_STORAGE_CLASS  # undef TCL_STORAGE_CLASS
453  # define TCL_STORAGE_CLASS DLLIMPORT  # define TCL_STORAGE_CLASS DLLIMPORT
454    
455  #endif /* _TCLWINPORT */  #endif /* _TCLWINPORT */
456    
457  /* End of tclwinport.h */  /* End of tclwinport.h */

Legend:
Removed from v.67  
changed lines
  Added in v.71

dashley@gmail.com
ViewVC Help
Powered by ViewVC 1.1.25