First, thanks for working on this. It is definitely needed in the manual. I have re-engineered this a couple of times already, but the collected wisdom should be in the manual in the first place.
Peter Rosin <p...@lysator.liu.se> writes: > #if defined _WIN32 && !defined __GNUC__ > # ifdef BUILDING_LIBFOO > # ifdef DLL_EXPORT > # define LIBFOO_SCOPE extern __declspec (dllexport) > # endif > # elif defined _MSC_VER || defined DLL_EXPORT > # define LIBFOO_SCOPE extern __declspec (dllimport) > # endif > #endif > #ifndef LIBFOO_SCOPE > # define LIBFOO_SCOPE extern > #endif I think it would help to namespace clarify this, to make it clear which CPP symbols are from the system and which are intended to be provided by the project itself. How about this: #if defined _WIN32 && !defined __GNUC__ # ifdef LIBFOO_BUILDING # ifdef LIBFOO_DLL_EXPORT # define LIBFOO_SCOPE extern __declspec (dllexport) # endif # elif defined _MSC_VER || defined LIBFOO_DLL_EXPORT # define LIBFOO_SCOPE extern __declspec (dllimport) # endif #endif #ifndef LIBFOO_SCOPE # define LIBFOO_SCOPE extern #endif However, I suspect people will need to adapt this block for their own projects. For comparison, in my projects I'm using a variant of this: # ifndef GSASL_API # if defined GSASL_BUILDING && defined HAVE_VISIBILITY && HAVE_VISIBILITY # define GSASL_API __attribute__((__visibility__("default"))) # elif defined GSASL_BUILDING && defined _MSC_VER && ! defined GSASL_STATIC # define GSASL_API __declspec(dllexport) # elif defined _MSC_VER && ! defined GSASL_STATIC # define GSASL_API __declspec(dllimport) # else # define GSASL_API # endif # endif /Simon _______________________________________________ http://lists.gnu.org/mailman/listinfo/libtool