ENH: Added support for building kwsys with GCC visibility support.

When kwsys is built using GCC visibility support can be used. This is similar
to the way that Windows exports symbols in DLLs, and requires projects that
build kwsys to change the default visibility using some compiler flags. See
http://gcc.gnu.org/wiki/Visibility for more details about GCC visibility.
This commit is contained in:
Marcus Hanwell 2010-01-06 12:00:36 -05:00
parent 4671b39363
commit b0a0714343
1 changed files with 9 additions and 5 deletions

View File

@ -88,11 +88,15 @@
#endif
/* Setup the export macro. */
#if defined(_WIN32) && @KWSYS_BUILD_SHARED@
# if defined(@KWSYS_NAMESPACE@_EXPORTS)
# define @KWSYS_NAMESPACE@_EXPORT __declspec(dllexport)
# else
# define @KWSYS_NAMESPACE@_EXPORT __declspec(dllimport)
#if @KWSYS_BUILD_SHARED@
# if defined(_WIN32) || defined(__CYGWIN__)
# if defined(@KWSYS_NAMESPACE@_EXPORTS)
# define @KWSYS_NAMESPACE@_EXPORT __declspec(dllexport)
# else
# define @KWSYS_NAMESPACE@_EXPORT __declspec(dllimport)
# endif
# elif __GNUC__ >= 4
# define @KWSYS_NAMESPACE@_EXPORT __attribute__ ((visibility("default")))
# endif
#else
# define @KWSYS_NAMESPACE@_EXPORT