This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Two cygwin-related changes


[reply-to set to newlib@sources.redhat.com]
I've checked in the below patch.  It solves two problems.

The macro definitions for cygwin for sigsetjmp and siglongjmp were
slightly incorrect.  The macro arguments were not properly protected
with parentheses.  See the long "[RFC] sigsetjmp/siglongjmp on cygwin"
thread on gdb@sources.redhat.com for more details.

The other part of the patch declares sys_errlist and sys_nerr for
legacy applications.  This will probably reduce the traffic in the
cygwin mailing list by 1 or 2%.

cgf

Mon Aug 13 22:26:01 2001  Christopher Faylor <cgf@cygnus.com>
 
 	* libc/include/machine/setjmp.h: Protect sigsetjmp/siglongjmp macro
 	arguments.
 
 	* libc/include/sys/errno.h: Declare sys_errlist and sys_nerr, under
 	Cygwin.

Index: libc/include/machine/setjmp.h
===================================================================
RCS file: /cvs/uberbaum/newlib/libc/include/machine/setjmp.h,v
retrieving revision 1.3
diff -p -r1.3 setjmp.h
*** setjmp.h	2001/03/08 21:39:31	1.3
--- setjmp.h	2001/08/14 02:34:25
*************** typedef int sigjmp_buf[_JBLEN+2];
*** 161,172 ****
  #define _SAVEMASK	_JBLEN
  #define _SIGMASK	(_JBLEN+1)
  
! #define sigsetjmp(env, savemask) (env[_SAVEMASK] = savemask,\
!                sigprocmask (SIG_SETMASK, 0, (sigset_t *) &env[_SIGMASK]),\
                 setjmp (env))
  
! #define siglongjmp(env, val) (((env[_SAVEMASK])?\
!                sigprocmask (SIG_SETMASK, (sigset_t *) &env[_SIGMASK], 0):0),\
                 longjmp (env, val))
  
  #endif /* __CYGWIN__ or __rtems__ */
--- 161,176 ----
  #define _SAVEMASK	_JBLEN
  #define _SIGMASK	(_JBLEN+1)
  
! #ifdef __CYGWIN__
! # define _CYGWIN_WORKING_SIGSETJMP
! #endif
! 
! #define sigsetjmp(env, savemask) ((env)[_SAVEMASK] = savemask,\
!                sigprocmask (SIG_SETMASK, 0, (sigset_t *) ((env) + _SIGMASK)),\
                 setjmp (env))
  
! #define siglongjmp(env, val) ((((env)[_SAVEMASK])?\
!                sigprocmask (SIG_SETMASK, (sigset_t *) ((env) + _SIGMASK), 0):0),\
                 longjmp (env, val))
  
  #endif /* __CYGWIN__ or __rtems__ */
Index: libc/include/sys/errno.h
===================================================================
RCS file: /cvs/uberbaum/newlib/libc/include/sys/errno.h,v
retrieving revision 1.6
diff -p -r1.6 errno.h
*** errno.h	2001/04/12 21:17:27	1.6
--- errno.h	2001/08/14 02:34:25
*************** extern int *__errno _PARAMS ((void));
*** 17,22 ****
--- 17,26 ----
  
  extern __IMPORT _CONST char * _CONST _sys_errlist[];
  extern __IMPORT int _sys_nerr;
+ #ifdef __CYGWIN__
+ extern __IMPORT const char * const sys_errlist[];
+ extern __IMPORT int sys_nerr;
+ #endif
  
  #define __errno_r(ptr) ((ptr)->_errno)
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]