mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* configure.in (rb_cv_gcc_atomic_builtins): check for atomic
builtins, all are not available in Apple derivative gcc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3ea90fc38e
commit
7b410abfb8
3 changed files with 19 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
Tue Oct 26 09:13:34 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* configure.in (rb_cv_gcc_atomic_builtins): check for atomic
|
||||
builtins, all are not available in Apple derivative gcc.
|
||||
|
||||
Tue Oct 26 00:29:26 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* Makefile.in (pkgconfig-data): create pkg-config metadata file.
|
||||
|
|
13
configure.in
13
configure.in
|
@ -775,6 +775,19 @@ if test "$GCC" = yes; then
|
|||
AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION_VOID(prot, name, args)],
|
||||
[RUBY_ALIAS_FUNCTION_TYPE(void, prot, name, args)])
|
||||
fi
|
||||
AC_CACHE_CHECK([for atomic builtins], [rb_cv_gcc_atomic_builtins], [
|
||||
AC_TRY_LINK([unsigned char atomic_var;],
|
||||
[
|
||||
__sync_lock_test_and_set(&atomic_var, 0);
|
||||
__sync_lock_test_and_set(&atomic_var, 1);
|
||||
__sync_fetch_and_add(&atomic_var, 1);
|
||||
__sync_fetch_and_sub(&atomic_var, 1);
|
||||
],
|
||||
[rb_cv_gcc_atomic_builtins=yes],
|
||||
[rb_cv_gcc_atomic_builtins=no])])
|
||||
if test "$rb_cv_gcc_atomic_builtins" = yes; then
|
||||
AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS)
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK(for exported function attribute, rb_cv_func_exported, [
|
||||
|
|
2
signal.c
2
signal.c
|
@ -25,7 +25,7 @@ typedef LONG rb_atomic_t;
|
|||
# define ATOMIC_INC(var) InterlockedIncrement(&(var))
|
||||
# define ATOMIC_DEC(var) InterlockedDecrement(&(var))
|
||||
|
||||
#elif __GNUC__ >= 4
|
||||
#elif defined HAVE_GCC_ATOMIC_BUILTINS
|
||||
/* @shyouhei hack to support atomic operations in case of gcc. Gcc
|
||||
* has its own pseudo-insns to support them. See info, or
|
||||
* http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html */
|
||||
|
|
Loading…
Reference in a new issue