Subject: Re: weak symbols on Cygwin
From: Bruno Haible <[email-masked]>
To: Dave Korn <[email-masked]>, [email-masked]
Cc: Eric Blake <[email-masked]>
Date: Thu, 8 Apr 2010 01:14:39 +0200
List-Id: <cygwin.cygwin.com>

Dave Korn wrote:
>> I've got some code, written for ELF platforms, that detects whether the
>> pthread library (often a separate library from libc) is linked, by doing
>>
>> #pragma weak pthread_cancel
>> bool pthread_in_use = (pthread_cancel != NULL); 
> 
>   And you really need to determine this dynamically at runtime rather than
> statically at configure time?

Sure. I want the same library (libintl) to be usable. on Unix,
  1) by multithreaded programs, without bugs due to simultaneous access
     to data by multiple threads,
  2) by single-threaded programs, without putting on them the performance
     price of linking with -lpthread.

"#pragma weak pthread_cancel" does exactly that.

Bruno

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