[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] Something to consider for future



On Sep 7, 2010, at 5:35 PM, Nick Mathewson wrote:

> The remaining non-static symbols are ones
> shared between modules, and of course C doesn't let you make those
> static.  The right solution here is probably to manually tell the
> linker about what symbols to export and what symbols not to export.
> On windows, this is the dllexport/dllimport stuff stuff.  With gcc4 on
> other platforms, this is the __attribute__((visibility(...))) stuff.
> ( http://gcc.gnu.org/wiki/Visibility )

A third easier option is to use GCC; visibility push and pop:

#pragma GCC visibility push(hidden)

protected objects, will be hidden in the ABI, but accessible from other modules

#pragma GCC visibility pop

See e.g. this for practical usage, http://code.google.com/p/libzdb/source/browse/trunk/src/db/ResultSet.c***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.