summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-13 15:43:55 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-13 15:43:55 +0000
commit9f7fde8d86a4d273be82804d09be82d822664729 (patch)
treee68ca255ed1423ab65fb971871e9b9129d690ae6 /configure.in
parent2564ccd5febb4742f7ec1279d9a747ab438160b4 (diff)
downloadruby-9f7fde8d86a4d273be82804d09be82d822664729.tar.gz
ruby-9f7fde8d86a4d273be82804d09be82d822664729.tar.xz
ruby-9f7fde8d86a4d273be82804d09be82d822664729.zip
* configure.in (rb_cv_gcc_function_alias): checks alias attribute.
* string.c (alias_func): replaced with RUBY_ALIAS_FUNCTION. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in17
1 files changed, 17 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index bd38c2b8b..1ad99ca5e 100644
--- a/configure.in
+++ b/configure.in
@@ -445,6 +445,23 @@ RUBY_FUNC_ATTRIBUTE(stdcall)
RUBY_FUNC_ATTRIBUTE(cdecl)
RUBY_FUNC_ATTRIBUTE(fastcall)
+if test "$GCC" = yes; then
+ AC_CACHE_CHECK([for function alias], [rb_cv_gcc_function_alias],
+ [rb_cv_gcc_function_alias=no
+ for a in alias weak,alias; do
+ AC_TRY_LINK([void foo(void) {}
+ void bar(void) __attribute__(($a("foo")));], [bar()],
+ [rb_cv_gcc_function_alias=$a; break])
+ done])
+ if test "$rb_cv_gcc_function_alias" = no; then
+ AC_DEFINE([RUBY_ALIAS_FUNCTION(old_prot, new_name, args)],
+ [VALUE old_prot {return new_name args;}])
+ else
+ AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION(old_prot, new_name, args)],
+ [VALUE old_prot __attribute__(($rb_cv_gcc_function_alias(@%:@new_name)));])
+ fi
+fi
+
AC_CACHE_CHECK([for RUBY_EXTERN], rb_cv_ruby_extern,
[rb_cv_ruby_extern=no
for mac in "__attribute__((dllimport))" "__declspec(dllimport)"; do