Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Dec 2011 22:11:31 -0500
From:      David Schultz <das@FreeBSD.ORG>
To:        Warner Losh <imp@bsdimp.com>
Cc:        Kostik Belousov <kostikbel@gmail.com>, Ed Schouten <ed@80386.nl>, threads@FreeBSD.ORG, arch@FreeBSD.ORG
Subject:   Re: [Patch] C1X threading support
Message-ID:  <20111217031131.GA15194@zim.MIT.EDU>
In-Reply-To: <FCFDD684-8E39-458B-A6A0-A7FE4834B888@bsdimp.com>
References:  <20111216214913.GA1771@hoeg.nl> <20111216220914.GW50300@deviant.kiev.zoral.com.ua> <20111216221959.GB1771@hoeg.nl> <20111216223126.GX50300@deviant.kiev.zoral.com.ua> <FCFDD684-8E39-458B-A6A0-A7FE4834B888@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 16, 2011, Warner Losh wrote:
> 
> On Dec 16, 2011, at 3:31 PM, Kostik Belousov wrote:
> 
> > On Fri, Dec 16, 2011 at 11:19:59PM +0100, Ed Schouten wrote:
> >> Hello Kostik,
> >> 
> >> * Kostik Belousov <kostikbel@gmail.com>, 20111216 23:09:
> >>> If application that does not use the new interface supposed to be
> >>> able to implement function with new names, then the not-underscored
> >>> symbols must be weak.
> >> 
> >> For example when an application wants to implement its own functions
> >> that are named thrd_*(), for example?
> > Yes. The realistic example is the code written to C99/SUSv4 conformance
> > that happens to define thrd_<something>.
> > 
> > It might be that easiest solution is to put the functions into
> > separate library, besides defining them weak.
> 
> I thought the canonical solution here was to say
> 
> #if POSIX_VISIBLE >= 201201
> <prototypes here>
> #endif
> 
> Except this isn't posix. :(

In this case it's #if __ISO_C_VISIBLE >= x (with the appropriate
changes in <sys/cdefs.h> for the new standard).  That deals with
visibility issues in the compiler.  The weak symbols deal with
visibility issues in the linker.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111217031131.GA15194>