Re: pthread.h small problem

2005-06-03 Thread Yuval Turgeman
On 6/2/05, Christopher Faylor <[EMAIL PROTECTED]> wrote:
> On Thu, Jun 02, 2005 at 12:52:56PM -0700, Shankar Unni wrote:
> >I'm pretty sure the braces are placed like that *deliberately*, to force
> >you to bracket code with the two macros or get a syntax error.
> 
> correct.

Got it... I can't use these macros if I'm wrapping pthread with my own
code, than... bummer.
Thanks.

-- 
Yuval Turgeman

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: pthread.h small problem

2005-06-02 Thread Christopher Faylor
On Thu, Jun 02, 2005 at 12:52:56PM -0700, Shankar Unni wrote:
>Yuval Turgeman wrote:
>>Hi,
>>The pthread_cleanup_push and pthread_cleanup_pop macros seems to be
>>broken in the CVS (misplaced brackets).  I hope I'm not posting to the
>>wrong list, but here's the patch...
>
>I'm pretty sure the braces are placed like that *deliberately*, to force 
>you to bracket code with the two macros or get a syntax error.

correct.

cgf

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: pthread.h small problem

2005-06-02 Thread Shankar Unni

Yuval Turgeman wrote:

Hi,
The pthread_cleanup_push and pthread_cleanup_pop macros seems to be
broken in the CVS (misplaced brackets).  I hope I'm not posting to the
wrong list, but here's the patch...


I'm pretty sure the braces are placed like that *deliberately*, to force 
you to bracket code with the two macros or get a syntax error.



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



pthread.h small problem

2005-06-02 Thread Yuval Turgeman
Hi,
The pthread_cleanup_push and pthread_cleanup_pop macros seems to be
broken in the CVS (misplaced brackets).  I hope I'm not posting to the
wrong list, but here's the patch...

--- ./winsup/cygwin/include/pthread.h.orig  2005-06-02
20:34:00.0 +0300
+++ ./winsup/cygwin/include/pthread.h   2005-06-02 20:34:59.0 +0300
@@ -118,8 +118,9 @@
 
 #define pthread_cleanup_push(_fn, _arg) { __pthread_cleanup_handler
__cleanup_handler = \
 { _fn, _arg, NULL }; \
-_pthread_cleanup_push(
&__cleanup_handler );
-#define pthread_cleanup_pop(_execute) _pthread_cleanup_pop( _execute ); }
+_pthread_cleanup_push(
&__cleanup_handler ); }
+
+#define pthread_cleanup_pop(_execute) _pthread_cleanup_pop( _execute );
 
 /* Condition variables */
 int pthread_cond_broadcast (pthread_cond_t *);


-- 
Yuval Turgeman

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/