1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

configure.in: setjmpex

* configure.in (setjmp-type): use setjmpex() on w64-mingw32 to get rid
  of -Wclobbered warnings.
* include/ruby/defines.h: include setjmpex.h here becase setjmp.h is
  included from win32.h via intrin.h, winnt.h, and so on.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-05-18 14:57:59 +00:00
parent 9cc1cc2045
commit 344db69c45
3 changed files with 27 additions and 5 deletions

View file

@ -1,3 +1,11 @@
Sat May 18 23:57:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (setjmp-type): use setjmpex() on w64-mingw32 to get rid
of -Wclobbered warnings.
* include/ruby/defines.h: include setjmpex.h here becase setjmp.h is
included from win32.h via intrin.h, winnt.h, and so on.
Sat May 18 20:28:12 2013 Tanaka Akira <akr@fsij.org> Sat May 18 20:28:12 2013 Tanaka Akira <akr@fsij.org>
* ext/socket/mkconstants.rb (INTEGER2NUM): Make less comparisons. * ext/socket/mkconstants.rb (INTEGER2NUM): Make less comparisons.

View file

@ -1028,6 +1028,7 @@ AC_CHECK_HEADERS( \
process.h \ process.h \
sys/prctl.h \ sys/prctl.h \
atomic.h \ atomic.h \
setjmpex.h
) )
dnl check for large file stuff dnl check for large file stuff
@ -1856,36 +1857,45 @@ AC_CACHE_CHECK(for __builtin_setjmp, ac_cv_func___builtin_setjmp,
test x$ac_cv_func__longjmp = xno && ac_cv_func__setjmp=no test x$ac_cv_func__longjmp = xno && ac_cv_func__setjmp=no
AC_MSG_CHECKING(for setjmp type) AC_MSG_CHECKING(for setjmp type)
setjmp_suffix=
AC_ARG_WITH(setjmp-type, AC_ARG_WITH(setjmp-type,
AS_HELP_STRING([--with-setjmp-type], [select setjmp type]), AS_HELP_STRING([--with-setjmp-type], [select setjmp type]),
[ [
AS_CASE([$withval], AS_CASE([$withval],
[__builtin_setjmp], [ setjmp_prefix=__builtin_], [__builtin_setjmp], [setjmp=__builtin_setjmp],
[_setjmp], [ setjmp_prefix=_], [_setjmp], [ setjmp_prefix=_],
[sigsetjmp], [ setjmp_prefix=sig], [sigsetjmp], [ setjmp_prefix=sig],
[setjmp], [ setjmp_prefix=], [setjmp], [ setjmp_prefix=],
[setjmpex], [ setjmp_prefix= setjmp_suffix=ex],
[''], [ unset setjmp_prefix], [''], [ unset setjmp_prefix],
[ AC_MSG_ERROR(invalid setjmp type: $withval)])], [unset setjmp_prefix]) [ AC_MSG_ERROR(invalid setjmp type: $withval)])], [unset setjmp_prefix])
if test ${setjmp_prefix+set}; then if test ${setjmp_prefix+set}; then
if test "${setjmp_prefix}" && eval test '$ac_cv_func_'${setjmp_prefix}setjmp = no; then if test "${setjmp_prefix}" && eval test '$ac_cv_func_'${setjmp_prefix}setjmp${setjmp_suffix} = no; then
AC_MSG_ERROR(${setjmp_prefix}setjmp is not available) AC_MSG_ERROR(${setjmp_prefix}setjmp${setjmp_suffix} is not available)
fi fi
elif test "$ac_cv_func___builtin_setjmp" = yes; then elif test "$ac_cv_func___builtin_setjmp" = yes; then
setjmp_prefix=__builtin_ setjmp_prefix=__builtin_
setjmp_suffix=
elif test "$ac_cv_header_setjmpex_h" = yes; then
setjmp_prefix=
setjmp_suffix=ex
elif test "$ac_cv_func__setjmp" = yes; then elif test "$ac_cv_func__setjmp" = yes; then
setjmp_prefix=_ setjmp_prefix=_
setjmp_suffix=
elif test "$ac_cv_func_sigsetjmp" = yes; then elif test "$ac_cv_func_sigsetjmp" = yes; then
AS_CASE([$target_os],[solaris*|cygwin*],[setjmp_prefix=],[setjmp_prefix=sig]) AS_CASE([$target_os],[solaris*|cygwin*],[setjmp_prefix=],[setjmp_prefix=sig])
setjmp_suffix=
else else
setjmp_prefix= setjmp_prefix=
setjmp_suffix=
fi fi
if test x$setjmp_prefix = xsig; then if test x$setjmp_prefix = xsig; then
setjmp_sigmask=yes setjmp_sigmask=yes
else else
unset setjmp_sigmask unset setjmp_sigmask
fi fi
AC_MSG_RESULT(${setjmp_prefix}setjmp) AC_MSG_RESULT(${setjmp_prefix}setjmp${setjmp_suffix})
AC_DEFINE_UNQUOTED([RUBY_SETJMP(env)], [${setjmp_prefix}setjmp(env${setjmp_sigmask+,0})]) AC_DEFINE_UNQUOTED([RUBY_SETJMP(env)], [${setjmp_prefix}setjmp${setjmp_suffix}(env${setjmp_sigmask+,0})])
AC_DEFINE_UNQUOTED([RUBY_LONGJMP(env,val)], [${setjmp_prefix}longjmp(env,val)]) AC_DEFINE_UNQUOTED([RUBY_LONGJMP(env,val)], [${setjmp_prefix}longjmp(env,val)])
AC_DEFINE_UNQUOTED(RUBY_JMP_BUF, ${setjmp_sigmask+${setjmp_prefix}}jmp_buf) AC_DEFINE_UNQUOTED(RUBY_JMP_BUF, ${setjmp_sigmask+${setjmp_prefix}}jmp_buf)
# End of setjmp check. # End of setjmp check.

View file

@ -61,6 +61,10 @@ extern "C" {
# include <sys/select.h> # include <sys/select.h>
#endif #endif
#ifdef HAVE_SETJMPEX_H
#include <setjmpex.h>
#endif
#define RUBY #define RUBY
#ifdef __cplusplus #ifdef __cplusplus