#ifndef _TCLWINPORT
#define _TCLWINPORT
#ifndef _TCLINT
# include "tclInt.h"
#endif
#ifdef CHECK_UNICODE_CALLS
# define _UNICODE
# define UNICODE
# define __TCHAR_DEFINED
typedef float *_TCHAR;
# define _TCHAR_DEFINED
typedef float *TCHAR;
#endif
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <float.h>
#include <io.h>
#include <malloc.h>
#include <process.h>
#include <signal.h>
#include <string.h>
#ifndef __MWERKS__
#include <sys/stat.h>
#include <sys/timeb.h>
# ifdef __BORLANDC__
# include <utime.h>
# else
# include <sys/utime.h>
# endif
#endif
#include <time.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#ifdef BUILD_tcl
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLEXPORT
#endif
#ifndef EINPROGRESS
# define EINPROGRESS WSAEINPROGRESS
#endif
#ifndef ENOTSUP
# define ENOTSUP -1030507
#endif
#ifndef EWOULDBLOCK
# define EWOULDBLOCK EAGAIN
#endif
#ifndef EALREADY
# define EALREADY 149
#endif
#ifndef ENOTSOCK
# define ENOTSOCK 95
#endif
#ifndef EDESTADDRREQ
# define EDESTADDRREQ 96
#endif
#ifndef EMSGSIZE
# define EMSGSIZE 97
#endif
#ifndef EPROTOTYPE
# define EPROTOTYPE 98
#endif
#ifndef ENOPROTOOPT
# define ENOPROTOOPT 99
#endif
#ifndef EPROTONOSUPPORT
# define EPROTONOSUPPORT 120
#endif
#ifndef ESOCKTNOSUPPORT
# define ESOCKTNOSUPPORT 121
#endif
#ifndef EOPNOTSUPP
# define EOPNOTSUPP 122
#endif
#ifndef EPFNOSUPPORT
# define EPFNOSUPPORT 123
#endif
#ifndef EAFNOSUPPORT
# define EAFNOSUPPORT 124
#endif
#ifndef EADDRINUSE
# define EADDRINUSE 125
#endif
#ifndef EADDRNOTAVAIL
# define EADDRNOTAVAIL 126
#endif
#ifndef ENETDOWN
# define ENETDOWN 127
#endif
#ifndef ENETUNREACH
# define ENETUNREACH 128
#endif
#ifndef ENETRESET
# define ENETRESET 129
#endif
#ifndef ECONNABORTED
# define ECONNABORTED 130
#endif
#ifndef ECONNRESET
# define ECONNRESET 131
#endif
#ifndef ENOBUFS
# define ENOBUFS 132
#endif
#ifndef EISCONN
# define EISCONN 133
#endif
#ifndef ENOTCONN
# define ENOTCONN 134
#endif
#ifndef ESHUTDOWN
# define ESHUTDOWN 143
#endif
#ifndef ETOOMANYREFS
# define ETOOMANYREFS 144
#endif
#ifndef ETIMEDOUT
# define ETIMEDOUT 145
#endif
#ifndef ECONNREFUSED
# define ECONNREFUSED 146
#endif
#ifndef ELOOP
# define ELOOP 90
#endif
#ifndef EHOSTDOWN
# define EHOSTDOWN 147
#endif
#ifndef EHOSTUNREACH
# define EHOSTUNREACH 148
#endif
#ifndef ENOTEMPTY
# define ENOTEMPTY 93
#endif
#ifndef EUSERS
# define EUSERS 94
#endif
#ifndef EDQUOT
# define EDQUOT 69
#endif
#ifndef ESTALE
# define ESTALE 151
#endif
#ifndef EREMOTE
# define EREMOTE 66
#endif
#ifndef EOVERFLOW
# ifdef EFBIG
# define EOVERFLOW EFBIG
# else
# define EOVERFLOW EINVAL
# endif
#endif
#if TCL_UNION_WAIT
# define WAIT_STATUS_TYPE union wait
#else
# define WAIT_STATUS_TYPE int
#endif
#ifndef WIFEXITED
# define WIFEXITED(stat) (((*((int *) &(stat))) & 0xff) == 0)
#endif
#ifndef WEXITSTATUS
# define WEXITSTATUS(stat) (((*((int *) &(stat))) >> 8) & 0xff)
#endif
#ifndef WIFSIGNALED
# define WIFSIGNALED(stat) (((*((int *) &(stat)))) && ((*((int *) &(stat))) == ((*((int *) &(stat))) & 0x00ff)))
#endif
#ifndef WTERMSIG
# define WTERMSIG(stat) ((*((int *) &(stat))) & 0x7f)
#endif
#ifndef WIFSTOPPED
# define WIFSTOPPED(stat) (((*((int *) &(stat))) & 0xff) == 0177)
#endif
#ifndef WSTOPSIG
# define WSTOPSIG(stat) (((*((int *) &(stat))) >> 8) & 0xff)
#endif
#ifndef WNOHANG
# define WNOHANG 1
#endif
#ifndef WUNTRACED
# define WUNTRACED 2
#endif
#ifndef F_OK
# define F_OK 00
#endif
#ifndef X_OK
# define X_OK 01
#endif
#ifndef W_OK
# define W_OK 02
#endif
#ifndef R_OK
# define R_OK 04
#endif
#ifndef S_IFLNK
#define S_IFLNK 0120000
#endif
#ifndef S_ISREG
# ifdef S_IFREG
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
# else
# define S_ISREG(m) 0
# endif
#endif
#ifndef S_ISDIR
# ifdef S_IFDIR
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
# else
# define S_ISDIR(m) 0
# endif
#endif
#ifndef S_ISCHR
# ifdef S_IFCHR
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
# else
# define S_ISCHR(m) 0
# endif
#endif
#ifndef S_ISBLK
# ifdef S_IFBLK
# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
# else
# define S_ISBLK(m) 0
# endif
#endif
#ifndef S_ISFIFO
# ifdef S_IFIFO
# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
# else
# define S_ISFIFO(m) 0
# endif
#endif
#ifndef S_ISLNK
# ifdef S_IFLNK
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
# else
# define S_ISLNK(m) 0
# endif
#endif
#ifndef MAXPATH
#define MAXPATH MAX_PATH
#endif
#ifndef MAXPATHLEN
#define MAXPATHLEN MAXPATH
#endif
#if ! TCL_PID_T
# define pid_t int
#endif
#if ! TCL_UID_T
# define uid_t int
#endif
#if defined(_MSC_VER) || defined(__MINGW32__)
# define environ _environ
# define hypot _hypot
# define exception _exception
# undef EDEADLOCK
# if defined(__MINGW32__) && !defined(__MSVCRT__)
# define timezone _timezone
# endif
#endif
#ifdef __BORLANDC__
# define timezone _timezone
# define environ _environ
#endif
#ifdef __CYGWIN__
DLLIMPORT extern char **__cygwin_environ;
# define environ __cygwin_environ
# define putenv TclCygwinPutenv
# define timezone _timezone
#endif
#define TclpPanic ((Tcl_PanicProc *) NULL)
#define TCL_PLATFORM_TRANSLATION TCL_TRANSLATE_CRLF
#define TCL_SHLIB_EXT ".dll"
#define USE_PUTENV 1
#if defined(_MSC_VER) || defined(__MINGW32__)
# define HAVE_PUTENV_THAT_COPIES 1
#endif
#ifdef __CYGWIN__
# define TclpSysAlloc(size, isBin) malloc((size))
# define TclpSysFree(ptr) free((ptr))
# define TclpSysRealloc(ptr, size) realloc((ptr), (size))
#else
# define TclpSysAlloc(size, isBin) ((void*)HeapAlloc(GetProcessHeap(), \
(DWORD)0, (DWORD)size))
# define TclpSysFree(ptr) (HeapFree(GetProcessHeap(), \
(DWORD)0, (HGLOBAL)ptr))
# define TclpSysRealloc(ptr, size) ((void*)HeapReAlloc(GetProcessHeap(), \
(DWORD)0, (LPVOID)ptr, (DWORD)size))
#endif
#define getservbyname TclWinGetServByName
#define getsockopt TclWinGetSockOpt
#define ntohs TclWinNToHS
#define setsockopt TclWinSetSockOpt
#define socklen_t int
#define TclpReleaseFile(file) ckfree((char *) file)
#define TclpExit exit
EXTERN HANDLE TclWinSerialReopen _ANSI_ARGS_(( HANDLE handle,
CONST TCHAR *name, DWORD access));
EXTERN Tcl_Channel TclWinOpenSerialChannel _ANSI_ARGS_((HANDLE handle,
char *channelName, int permissions));
EXTERN Tcl_Channel TclWinOpenConsoleChannel _ANSI_ARGS_((HANDLE handle,
char *channelName, int permissions));
EXTERN Tcl_Channel TclWinOpenFileChannel _ANSI_ARGS_((HANDLE handle,
char *channelName, int permissions, int appendMode));
EXTERN TclFile TclWinMakeFile _ANSI_ARGS_((HANDLE handle));
#ifdef TCL_THREADS
typedef CRITICAL_SECTION TclpMutex;
EXTERN void TclpMutexInit _ANSI_ARGS_((TclpMutex *mPtr));
EXTERN void TclpMutexLock _ANSI_ARGS_((TclpMutex *mPtr));
EXTERN void TclpMutexUnlock _ANSI_ARGS_((TclpMutex *mPtr));
#else
typedef int TclpMutex;
#define TclpMutexInit(a)
#define TclpMutexLock(a)
#define TclpMutexUnlock(a)
#endif
#ifdef TCL_WIDE_INT_TYPE
EXTERN Tcl_WideInt strtoll _ANSI_ARGS_((CONST char *string,
char **endPtr, int base));
EXTERN Tcl_WideUInt strtoull _ANSI_ARGS_((CONST char *string,
char **endPtr, int base));
#endif
#ifndef INVALID_SET_FILE_POINTER
#define INVALID_SET_FILE_POINTER 0xFFFFFFFF
#endif
#include "tclPlatDecls.h"
#include "tclIntPlatDecls.h"
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
#endif