summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2005-10-14 11:14:31 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2005-10-14 11:14:31 (GMT)
commit25dac25a7acae9b4d403cd3a02160e7470be5c18 (patch)
tree00b6ea924753f686a36c10ce34028e4b294df520
parent4c4dbba0fe0d26097c20ac8bc74b873c7adbb28c (diff)
downloadtcl-25dac25a7acae9b4d403cd3a02160e7470be5c18.zip
tcl-25dac25a7acae9b4d403cd3a02160e7470be5c18.tar.gz
tcl-25dac25a7acae9b4d403cd3a02160e7470be5c18.tar.bz2
* generic/tcl.h: Fix for bug #1256937 - correctly decorate
* generic/tclMain.c: imported functions from msvcrt in static builds.
-rw-r--r--ChangeLog5
-rw-r--r--generic/tcl.h20
-rw-r--r--generic/tclMain.c4
3 files changed, 25 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 3518644..465e370 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-10-14 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * generic/tcl.h: Fix for bug #1256937 - correctly decorate
+ * generic/tclMain.c: imported functions from msvcrt in static builds.
+
2005-10-13 Donal K. Fellows <donal.k.fellows@man.ac.uk>
* tests/format.test: "Forward"-port of test updates relating to
diff --git a/generic/tcl.h b/generic/tcl.h
index 0d43309..5e91a5a 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tcl.h,v 1.204 2005/10/08 14:42:44 dgp Exp $
+ * RCS: @(#) $Id: tcl.h,v 1.205 2005/10/14 11:14:31 patthoyts Exp $
*/
#ifndef _TCL
@@ -175,18 +175,34 @@ extern "C" {
* windows is for a DLL, which causes the DLLIMPORT and DLLEXPORT macros to be
* nonempty. To build a static library, the macro STATIC_BUILD should be
* defined.
+ *
+ * Note: when building static but linking dynamically to MSVCRT we must still
+ * correctly decorate the C library imported function. Use CRTIMPORT
+ * for this purpose. _DLL is defined by the compiler when linking to
+ * MSVCRT.
*/
+#if (defined(__WIN32__) && (defined(_MSC_VER) || (__BORLANDC__ >= 0x0550) || defined(__LCC__) || defined(__WATCOMC__) || (defined(__GNUC__) && defined(__declspec))))
+# define HAVE_DECLSPEC 1
+#endif
+
#ifdef STATIC_BUILD
# define DLLIMPORT
# define DLLEXPORT
+# if HAVE_DECLSPEC && defined(_DLL)
+# define CRTIMPORT __declspec(dllimport)
+# else
+# define CRTIMPORT
+# endif
#else
-# if (defined(__WIN32__) && (defined(_MSC_VER) || (__BORLANDC__ >= 0x0550) || defined(__LCC__) || defined(__WATCOMC__) || (defined(__GNUC__) && defined(__declspec))))
+# if HAVE_DECLSPEC
# define DLLIMPORT __declspec(dllimport)
# define DLLEXPORT __declspec(dllexport)
+# define CRTIMPORT __declspec(dllimport)
# else
# define DLLIMPORT
# define DLLEXPORT
+# define CRTEXPORT
# endif
#endif
diff --git a/generic/tclMain.c b/generic/tclMain.c
index f755a8d..ae7f3b9 100644
--- a/generic/tclMain.c
+++ b/generic/tclMain.c
@@ -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: tclMain.c,v 1.33 2005/09/30 19:31:16 dgp Exp $
+ * RCS: @(#) $Id: tclMain.c,v 1.34 2005/10/14 11:14:31 patthoyts Exp $
*/
#include "tclInt.h"
@@ -30,7 +30,7 @@
* source directory to make their own modified versions).
*/
-extern DLLIMPORT int isatty _ANSI_ARGS_((int fd));
+extern CRTIMPORT int isatty _ANSI_ARGS_((int fd));
static Tcl_Obj *tclStartupScriptPath = NULL;
static Tcl_Obj *tclStartupScriptEncoding = NULL;