From c9d8a2406d6da4642c7f29dd3229bd0ec875b49f Mon Sep 17 00:00:00 2001 From: rakshasa Date: Fri, 27 Oct 2006 13:07:36 +0000 Subject: [PATCH] * Added symbol export attributes to the API and made the rest hidden by default. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@798 e378c898-3ddf-0310-93e7-cc216c733640 --- scripts/attributes.m4 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/attributes.m4 b/scripts/attributes.m4 index a153f528..d04449b7 100644 --- a/scripts/attributes.m4 +++ b/scripts/attributes.m4 @@ -58,6 +58,25 @@ AC_DEFUN([CC_ATTRIBUTE_INTERNAL], [ fi ]) +AC_DEFUN([CC_ATTRIBUTE_DEFAULT], [ + AC_CACHE_CHECK([if compiler supports __attribute__((visibility("default")))], + [cc_cv_attribute_default], + [AC_COMPILE_IFELSE([ + void __attribute__((visibility("default"))) default_function() { } + ], + [cc_cv_attribute_default=yes], + [cc_cv_attribute_default=no]) + ]) + + if test "x$cc_cv_attribute_default" = "xyes"; then + AC_DEFINE([SUPPORT_ATTRIBUTE_DEFAULT], 1, [Define this if the compiler supports the default visibility attribute]) + $1 + else + true + $2 + fi +]) + AC_DEFUN([CC_ATTRIBUTE_NONNULL], [ AC_CACHE_CHECK([if compiler supports __attribute__((nonnull()))], [cc_cv_attribute_nonnull],