* 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
@ -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>
|
Tue Oct 26 00:29:26 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* Makefile.in (pkgconfig-data): create pkg-config metadata file.
|
* 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)],
|
AC_DEFINE_UNQUOTED([RUBY_ALIAS_FUNCTION_VOID(prot, name, args)],
|
||||||
[RUBY_ALIAS_FUNCTION_TYPE(void, prot, name, args)])
|
[RUBY_ALIAS_FUNCTION_TYPE(void, prot, name, args)])
|
||||||
fi
|
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
|
fi
|
||||||
|
|
||||||
AC_CACHE_CHECK(for exported function attribute, rb_cv_func_exported, [
|
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_INC(var) InterlockedIncrement(&(var))
|
||||||
# define ATOMIC_DEC(var) InterlockedDecrement(&(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
|
/* @shyouhei hack to support atomic operations in case of gcc. Gcc
|
||||||
* has its own pseudo-insns to support them. See info, or
|
* has its own pseudo-insns to support them. See info, or
|
||||||
* http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html */
|
* http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user