summaryrefslogtreecommitdiffstats
path: root/win/tclWinPort.h
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-09-27 00:50:10 (GMT)
committerhobbs <hobbs>2002-09-27 00:50:10 (GMT)
commitb96b459a4907a164acb205a2b024c2c8419ea496 (patch)
tree7ecd449f330b92357eb4737a43574667df864290 /win/tclWinPort.h
parent4985043c6ed39477bf0abc04fe017cccfd090f62 (diff)
downloadtcl-b96b459a4907a164acb205a2b024c2c8419ea496.zip
tcl-b96b459a4907a164acb205a2b024c2c8419ea496.tar.gz
tcl-b96b459a4907a164acb205a2b024c2c8419ea496.tar.bz2
2002-09-18 Mumit Khan <khan@nanotech.wisc.edu>
Added basic Cygwin support. * win/tcl.m4 (SC_PATH_TCLCONFIG): Support one-tree build. (SC_PATH_TKCONFIG): Likewise. (SC_PROG_TCLSH): Likewise. (SC_CONFIG_CFLAGS): Assume real Cygwin port and remove -mno-cygwin flags. Add -mwin32 to extra_cflags and extra_ldflags. Remove ``-e _WinMain@16'' from LDFLAGS_WINDOW. * win/configure.in: Allow Cygwin build. (SEH test): Define to be 1 instead of empty value. (EXCEPTION_DISPOSITION): Add test. * win/configure: Regenerate. * generic/tcl.h: Don't explicitly define __WIN32__ for Cygwin, let the user decide whether to use Windows or POSIX personality. (TCL_WIDE_INT_TYPE, TCL_LL_MODIFIER, struct Tcl_StatBuf): Define for Cygwin. * generic/tclEnv.c (Tcl_CygwinPutenv): putenv replacement for Cygwin. * generic/tclFileName.c (Tcl_TranslateFileName): Convert POSIX to native format. (TclDoGlob): Likewise. * generic/tclPlatDecls.h (TCHAR): Define for Cygwin. * win/tclWinPort.h (putenv, TclpSysAlloc, TclpSysFree, TclpSysRealloc): Define for Cygwin.
Diffstat (limited to 'win/tclWinPort.h')
-rw-r--r--win/tclWinPort.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/win/tclWinPort.h b/win/tclWinPort.h
index a616f22..011a061 100644
--- a/win/tclWinPort.h
+++ b/win/tclWinPort.h
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinPort.h,v 1.33 2002/08/28 22:48:48 davygrvy Exp $
+ * RCS: @(#) $Id: tclWinPort.h,v 1.34 2002/09/27 00:50:10 hobbs Exp $
*/
#ifndef _TCLWINPORT
@@ -380,9 +380,10 @@
#endif /* __BORLANDC__ */
#ifdef __CYGWIN__
-/* On cygwin32, the environment is imported from the cygwin32 DLL. */
+/* On Cygwin, the environment is imported from the Cygwin DLL. */
DLLIMPORT extern char **__cygwin_environ;
# define environ __cygwin_environ
+# define putenv TclCygwinPutenv
# define timezone _timezone
#endif /* __CYGWIN__ */
@@ -433,12 +434,18 @@
* use by tclAlloc.c.
*/
-#define TclpSysAlloc(size, isBin) ((void*)HeapAlloc(GetProcessHeap(), \
+#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(), \
+# define TclpSysFree(ptr) (HeapFree(GetProcessHeap(), \
(DWORD)0, (HGLOBAL)ptr))
-#define TclpSysRealloc(ptr, size) ((void*)HeapReAlloc(GetProcessHeap(), \
+# define TclpSysRealloc(ptr, size) ((void*)HeapReAlloc(GetProcessHeap(), \
(DWORD)0, (LPVOID)ptr, (DWORD)size))
+#endif
/*
* The following defines map from standard socket names to our internal