summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-14 06:33:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-14 06:33:06 +0000
commitdccf9e0c45f1f450d28ba0700dbb459247ba9f9d (patch)
tree8ef41c677fb06897c021b8d6615b70724d2efad3 /configure.in
parenta23b1f745038f93e5cd2542fbf17b363686ccfd7 (diff)
* configure.in, include/ruby/defines.h (RUBY_FUNC_EXPORTED): macro
to declare exported function. * array.c (rb_ary_memsize), string.c (rb_str_memsize), variable.c (rb_objspace_data_type_memsize): used in objspace. [ruby-dev:42022] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in13
1 files changed, 13 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 7afaea97f3..9456da1e07 100644
--- a/configure.in
+++ b/configure.in
@@ -753,6 +753,19 @@ if test "$GCC" = yes; then
fi
fi
+AC_CACHE_CHECK(for exported function attribute, rb_cv_func_exported, [
+rb_cv_func_exported=no
+RUBY_WERROR_FLAG([
+for mac in '__attribute__ ((visibility("default")))' '__declspec(dllexport)'; do
+ AC_TRY_COMPILE([@%:@define RUBY_FUNC_EXPORTED $mac extern
+ RUBY_FUNC_EXPORTED void conftest_attribute_check(void);], [],
+ [rb_cv_func_exported="$mac"; break])
+done
+])])
+if test "$rb_cv_func_exported" != no; then
+ AC_DEFINE_UNQUOTED(RUBY_FUNC_EXPORTED, [$rb_cv_func_exported extern])
+fi
+
RUBY_APPEND_OPTION(XCFLAGS, -DRUBY_EXPORT)
dnl }