diff --git a/msvc/ecl/config.h.msvc6 b/msvc/ecl/config.h.msvc6 index 1d7904163..4e3d03978 100644 --- a/msvc/ecl/config.h.msvc6 +++ b/msvc/ecl/config.h.msvc6 @@ -13,6 +13,30 @@ See file '../Copyright' for full details. */ +/* + * If ECL_API has been predefined, that means we are building the core + * library and, under windows, we must tell the compiler to export + * extern functions from the shared library. + * If ECL_API is not defined, we are simply building an application that + * uses ECL and, under windows, we must tell the compiler that certain + * will be imported from a DLL. + */ +#if defined(mingw32) || defined(_MSC_VER) || defined(cygwin) +# define ECL_DLLEXPORT __declspec(dllexport) +# ifdef ECL_API +# undef ECL_API +# define ECL_API __declspec(dllexport) +# else +# define ECL_API __declspec(dllimport) +# endif +#else +# define ECL_DLLEXPORT +# ifdef ECL_API +# undef ECL_API +# endif +# define ECL_API +#endif + /* * FEATURES LINKED IN */