From ae70bad153d5dfe6aabae15acc249f6e5a45102c Mon Sep 17 00:00:00 2001 From: escoffon Date: Wed, 29 Jul 1998 11:09:48 +0000 Subject: Added support for DLL import/export declarations in the EXTERN macro --- generic/tcl.h | 59 ++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/generic/tcl.h b/generic/tcl.h index 2742a6d..56f5e44 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * SCCS: %Z% $Id: tcl.h,v 1.13 1998/07/24 13:49:40 surles Exp $ + * SCCS: %Z% $Id: tcl.h,v 1.14 1998/07/29 11:09:48 escoffon Exp $ */ #ifndef _TCL @@ -157,6 +157,37 @@ #endif /* + * Macros used to declare a function to be exported by a DLL. + * Used by Windows, maps to no-op declarations on non-Windows systems + */ + +#ifdef DLL_BUILD +# ifdef __WIN32__ +# ifdef _MSC_VER +# define DLLIMPORT __declspec(dllimport) +# define DLLEXPORT __declspec(dllexport) +# endif +# else +# define DLLIMPORT +# define DLLEXPORT +# define EXPORT +# endif +#else +# define DLLIMPORT +# define DLLEXPORT +# define EXPORT +#endif + +#ifdef EXPORT +# undef EXPORT +#endif +#ifdef BUILD_tcl +# define EXPORT DLLEXPORT +#else +# define EXPORT DLLIMPORT +#endif + +/* * Definitions that allow this header file to be used either with or * without ANSI C features like function prototypes. */ @@ -174,9 +205,9 @@ #endif #ifdef __cplusplus -# define EXTERN extern "C" +# define EXTERN extern "C" EXPORT #else -# define EXTERN extern +# define EXTERN extern EXPORT #endif /* @@ -205,28 +236,6 @@ typedef long LONG; #endif /* __WIN32__ */ /* - * Macro used to declare a function to be exported by a DLL. - * Used by windows, maps to a simple declaration on non-windows systems - */ -#ifdef __WIN32__ -# ifdef STATIC_BUILD -# define EXPORT(a,b) a b -# else -# if defined(_MSC_VER) -# define EXPORT(a,b) __declspec(dllexport) a b -# else -# if defined(__BORLANDC__) -# define EXPORT(a,b) a _export b -# else -# define EXPORT(a,b) a b -# endif -# endif -# endif -#else -# define EXPORT(a,b) a b -#endif - -/* * Miscellaneous declarations. */ -- cgit v0.12