Module: wine Branch: master Commit: 10e795a091d1af473388d9dbc27c00feb0f25404 URL: http://source.winehq.org/git/wine.git/?a=commit;h=10e795a091d1af473388d9dbc2...
Author: Alexandre Julliard julliard@winehq.org Date: Mon May 26 19:23:43 2008 +0200
libport: Move the sigsetjmp replacement to exception.h to make it available for Winelib too.
---
configure | 63 ---------------------------------------------- configure.ac | 11 -------- include/config.h.in | 3 -- include/wine/exception.h | 6 ++++ include/wine/port.h | 7 ----- libs/port/Makefile.in | 1 - libs/port/sigsetjmp.c | 36 -------------------------- 7 files changed, 6 insertions(+), 121 deletions(-)
diff --git a/configure b/configure index 2cccc91..a0ba584 100755 --- a/configure +++ b/configure @@ -14450,69 +14450,6 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking for sigsetjmp" >&5 -echo $ECHO_N "checking for sigsetjmp... $ECHO_C" >&6; } -if test "${ac_cv_c_sigsetjmp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <setjmp.h> -int -main () -{ -sigjmp_buf buf; - sigsetjmp( buf, 1 ); - siglongjmp( buf, 1 ); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *"* | *`* | *\*) ac_try_echo=$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo "$as_me:$LINENO: $ac_try_echo"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: $? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_c_sigsetjmp="yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_sigsetjmp="no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_sigsetjmp" >&5 -echo "${ECHO_T}$ac_cv_c_sigsetjmp" >&6; } -if test "$ac_cv_c_sigsetjmp" = "yes" -then - -cat >>confdefs.h <<_ACEOF -#define HAVE_SIGSETJMP 1 -_ACEOF - -fi - { echo "$as_me:$LINENO: checking for pthread_rwlock_t" >&5 echo $ECHO_N "checking for pthread_rwlock_t... $ECHO_C" >&6; } if test "${ac_cv_type_pthread_rwlock_t+set}" = set; then diff --git a/configure.ac b/configure.ac index 59dc996..8bbb9d5 100644 --- a/configure.ac +++ b/configure.ac @@ -1049,17 +1049,6 @@ then AC_DEFINE(HAVE___VA_COPY, 1, [Define if we have __va_copy]) fi
-dnl **** Check for sigsetjmp **** -AC_CACHE_CHECK([for sigsetjmp], ac_cv_c_sigsetjmp, - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <setjmp.h>]], [[sigjmp_buf buf; - sigsetjmp( buf, 1 ); - siglongjmp( buf, 1 );]])],[ac_cv_c_sigsetjmp="yes"],[ac_cv_c_sigsetjmp="no"]) - ) -if test "$ac_cv_c_sigsetjmp" = "yes" -then - AC_DEFINE(HAVE_SIGSETJMP, 1, [Define to 1 if you have the sigsetjmp (and siglongjmp) function]) -fi - dnl **** Check for pthread_rwlock_t **** AC_CHECK_TYPES([pthread_rwlock_t, pthread_rwlockattr_t],,,[#define _GNU_SOURCE #include <pthread.h>]) diff --git a/include/config.h.in b/include/config.h.in index d956790..9833b23 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -615,9 +615,6 @@ /* Define to 1 if you have the `sigprocmask' function. */ #undef HAVE_SIGPROCMASK
-/* Define to 1 if you have the sigsetjmp (and siglongjmp) function */ -#undef HAVE_SIGSETJMP - /* Define to 1 if the system has the type `sigset_t'. */ #undef HAVE_SIGSET_T
diff --git a/include/wine/exception.h b/include/wine/exception.h index 590479c..d716bf0 100644 --- a/include/wine/exception.h +++ b/include/wine/exception.h @@ -82,6 +82,12 @@ #define __attribute__(x) /* nothing */ #endif
+#if defined(__MINGW32__) || defined(__CYGWIN__) +#define sigjmp_buf jmp_buf +#define sigsetjmp(buf,sigs) setjmp(buf) +#define siglongjmp(buf,val) longjmp(buf,val) +#endif + #define __TRY \ do { __WINE_FRAME __f; \ int __first = 1; \ diff --git a/include/wine/port.h b/include/wine/port.h index 01ee835..4f58de8 100644 --- a/include/wine/port.h +++ b/include/wine/port.h @@ -323,13 +323,6 @@ ssize_t pwrite( int fd, const void *buf, size_t count, off_t offset ); int readlink( const char *path, char *buf, size_t size ); #endif /* HAVE_READLINK */
-#ifndef HAVE_SIGSETJMP -# include <setjmp.h> -typedef jmp_buf sigjmp_buf; -int sigsetjmp( sigjmp_buf buf, int savesigs ); -void siglongjmp( sigjmp_buf buf, int val ); -#endif /* HAVE_SIGSETJMP */ - #ifndef HAVE_STATVFS int statvfs( const char *path, struct statvfs *buf ); #endif diff --git a/libs/port/Makefile.in b/libs/port/Makefile.in index 1c25bf2..1d048d0 100644 --- a/libs/port/Makefile.in +++ b/libs/port/Makefile.in @@ -23,7 +23,6 @@ C_SRCS = \ pread.c \ pwrite.c \ readlink.c \ - sigsetjmp.c \ spawn.c \ statvfs.c \ strcasecmp.c \ diff --git a/libs/port/sigsetjmp.c b/libs/port/sigsetjmp.c deleted file mode 100644 index 466270f..0000000 --- a/libs/port/sigsetjmp.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * sigsetjmp/siglongjmp functions - * - * Copyright 2003 Alexandre Julliard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "config.h" -#include "wine/port.h" - -#ifndef HAVE_SIGSETJMP - -int sigsetjmp( sigjmp_buf buf, int savesigs ) -{ - return setjmp( buf ); -} - -void siglongjmp( sigjmp_buf buf, int val ) -{ - longjmp( buf, val ); -} - -#endif /* HAVE_SIGSETJMP */