[cairo] "export" annotations on public APIs

Carl Worth cworth at cworth.org
Tue May 10 13:08:49 PDT 2005


On Thu, 21 Apr 2005 15:59:12 +1200, Robert O'Callahan wrote:
> Integrating Cairo into Mozilla, we've run into a problem building Cairo as a 
> shared library --- there are no annotations to indicate which functions 
> should be exported from a shared library, when building on a platform that 
> doesn't export all symbols by default.

We have gone through the complementary effort and annotated each
function that should not be exported with "cairo_private", (though we
might not have 100% of the functions tagged at the moment). Could
those annotations be adequate for your use?

>                                        This affects not only Win32, but now 
> also gcc4 when we use "#pragma GCC visibility" to hide internal symbols. 
> Would a patch that adds a CAIRO_EXPORT macro to all public functions (by 
> default, defined to nothing) be looked upon favourably?

One thing I really like about annotating the non-exported functions is
that the public header file does not get cluttered and, as such,
maintains quite good readability. I'd like to preserve that if we can.

If annotations in the public header do prove unavoidable I might
suggest "cairo_public" as an annotation to maintain consistency with
our current cairo_private annotation. (But again, I'd prefer to only
have to mark the private functions).

-Carl


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050510/efe174a3/attachment.pgp


More information about the cairo mailing list