mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* configure.in (rb_cv_gcc_function_alias): checks alias attribute.
* string.c (alias_func): replaced with RUBY_ALIAS_FUNCTION. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									ca3c54c0ee
								
							
						
					
					
						commit
						3622cd196c
					
				
					 3 changed files with 31 additions and 16 deletions
				
			
		| 
						 | 
				
			
			@ -1,3 +1,9 @@
 | 
			
		|||
Thu Aug 14 00:43:53 2008  Nobuyoshi Nakada  <nobu@ruby-lang.org>
 | 
			
		||||
 | 
			
		||||
	* configure.in (rb_cv_gcc_function_alias): checks alias attribute.
 | 
			
		||||
 | 
			
		||||
	* string.c (alias_func): replaced with RUBY_ALIAS_FUNCTION.
 | 
			
		||||
 | 
			
		||||
Wed Aug 13 23:42:49 2008  Nobuyoshi Nakada  <nobu@ruby-lang.org>
 | 
			
		||||
 | 
			
		||||
	* common.mk (parse.h): fake rule.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										17
									
								
								configure.in
									
										
									
									
									
								
							
							
						
						
									
										17
									
								
								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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										24
									
								
								string.c
									
										
									
									
									
								
							
							
						
						
									
										24
									
								
								string.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -43,14 +43,6 @@
 | 
			
		|||
VALUE rb_cString;
 | 
			
		||||
VALUE rb_cSymbol;
 | 
			
		||||
 | 
			
		||||
#ifdef __GNUC__
 | 
			
		||||
#define alias_func(old_prot, new_name, args) \
 | 
			
		||||
VALUE old_prot __attribute__((weak, alias(#new_name)));
 | 
			
		||||
#else
 | 
			
		||||
#define alias_func(old_prot, new_name, args) \
 | 
			
		||||
VALUE old_prot {return new_name args;}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define STR_TMPLOCK FL_USER7
 | 
			
		||||
#define STR_NOEMBED FL_USER1
 | 
			
		||||
#define STR_SHARED  FL_USER2 /* = ELTS_SHARED */
 | 
			
		||||
| 
						 | 
				
			
			@ -440,7 +432,7 @@ rb_str_new_cstr(const char *ptr)
 | 
			
		|||
    return rb_str_new(ptr, strlen(ptr));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
alias_func(rb_str_new2(const char *ptr), rb_str_new_cstr, (ptr))
 | 
			
		||||
RUBY_ALIAS_FUNCTION(rb_str_new2(const char *ptr), rb_str_new_cstr, (ptr))
 | 
			
		||||
#define rb_str_new2 rb_str_new_cstr
 | 
			
		||||
 | 
			
		||||
VALUE
 | 
			
		||||
| 
						 | 
				
			
			@ -451,7 +443,7 @@ rb_usascii_str_new_cstr(const char *ptr)
 | 
			
		|||
    return str;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
alias_func(rb_usascii_str_new2(const char *ptr), rb_usascii_str_new_cstr, (ptr))
 | 
			
		||||
RUBY_ALIAS_FUNCTION(rb_usascii_str_new2(const char *ptr), rb_usascii_str_new_cstr, (ptr))
 | 
			
		||||
#define rb_usascii_str_new2 rb_usascii_str_new_cstr
 | 
			
		||||
 | 
			
		||||
VALUE
 | 
			
		||||
| 
						 | 
				
			
			@ -472,7 +464,7 @@ rb_tainted_str_new_cstr(const char *ptr)
 | 
			
		|||
    return str;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
alias_func(rb_tainted_str_new2(const char *ptr), rb_tainted_str_new_cstr, (ptr))
 | 
			
		||||
RUBY_ALIAS_FUNCTION(rb_tainted_str_new2(const char *ptr), rb_tainted_str_new_cstr, (ptr))
 | 
			
		||||
#define rb_tainted_str_new2 rb_tainted_str_new_cstr
 | 
			
		||||
 | 
			
		||||
static VALUE
 | 
			
		||||
| 
						 | 
				
			
			@ -516,7 +508,7 @@ rb_str_new_shared(VALUE str)
 | 
			
		|||
    return str2;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
alias_func(rb_str_new3(VALUE str), rb_str_new_shared, (str))
 | 
			
		||||
RUBY_ALIAS_FUNCTION(rb_str_new3(VALUE str), rb_str_new_shared, (str))
 | 
			
		||||
#define rb_str_new3 rb_str_new_shared
 | 
			
		||||
 | 
			
		||||
static VALUE
 | 
			
		||||
| 
						 | 
				
			
			@ -579,7 +571,7 @@ rb_str_new_frozen(VALUE orig)
 | 
			
		|||
    return str;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
alias_func(rb_str_new4(VALUE orig), rb_str_new_frozen, (orig))
 | 
			
		||||
RUBY_ALIAS_FUNCTION(rb_str_new4(VALUE orig), rb_str_new_frozen, (orig))
 | 
			
		||||
#define rb_str_new4 rb_str_new_frozen
 | 
			
		||||
 | 
			
		||||
VALUE
 | 
			
		||||
| 
						 | 
				
			
			@ -588,7 +580,7 @@ rb_str_new_with_class(VALUE obj, const char *ptr, long len)
 | 
			
		|||
    return str_new(rb_obj_class(obj), ptr, len);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
alias_func(rb_str_new5(VALUE obj, const char *ptr, long len),
 | 
			
		||||
RUBY_ALIAS_FUNCTION(rb_str_new5(VALUE obj, const char *ptr, long len),
 | 
			
		||||
	   rb_str_new_with_class, (obj, ptr, len))
 | 
			
		||||
#define rb_str_new5 rb_str_new_with_class
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -622,7 +614,7 @@ rb_str_buf_new_cstr(const char *ptr)
 | 
			
		|||
    return str;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
alias_func(rb_str_buf_new2(const char *ptr), rb_str_buf_new_cstr, (ptr))
 | 
			
		||||
RUBY_ALIAS_FUNCTION(rb_str_buf_new2(const char *ptr), rb_str_buf_new_cstr, (ptr))
 | 
			
		||||
#define rb_str_buf_new2 rb_str_buf_new_cstr
 | 
			
		||||
 | 
			
		||||
VALUE
 | 
			
		||||
| 
						 | 
				
			
			@ -1365,7 +1357,7 @@ rb_str_freeze(VALUE str)
 | 
			
		|||
    return rb_obj_freeze(str);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
alias_func(rb_str_dup_frozen(VALUE str), rb_str_new_frozen, (str))
 | 
			
		||||
RUBY_ALIAS_FUNCTION(rb_str_dup_frozen(VALUE str), rb_str_new_frozen, (str))
 | 
			
		||||
#define rb_str_dup_frozen rb_str_new_frozen
 | 
			
		||||
 | 
			
		||||
VALUE
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue