This is the mail archive of the
mailing list for the Cygwin project.
Re: weak symbols on Cygwin
- From: Bruno Haible <bruno at clisp dot org>
- To: Dave Korn <dave dot korn dot cygwin at googlemail dot com>, cygwin at cygwin dot com
- Cc: Eric Blake <eblake at redhat dot com>
- Date: Thu, 8 Apr 2010 01:14:39 +0200
- Subject: Re: weak symbols on Cygwin
- References: <4BBB31C6.firstname.lastname@example.org> <4BBCBADA.email@example.com> <4BBCBB14.firstname.lastname@example.org>
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.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple