[PATCH] Use FFI_DECLARE macros

Mladen Turk mturk@redhat.com
Tue Mar 2 21:33:00 GMT 2010


On 02/24/2010 06:59 PM, Dan Witte wrote:
> ----- "Mladen Turk"<mturk@redhat.com>  wrote:
>
>>
>> Right this is one of the options.
>> Using define in client code allows to ship the dynamic
>> and static lib with the same set of headers.
>
> Ah, OK. That's certainly not a use case for us (and probably anyone who's embedding libffi in their app), so perhaps you could have the substitution "do the right thing" for the common case, and have additional FFI_FORCE_STATIC/FFI_FORCE_SHARED to override that people can #define before #including ffi.h?
>

Actually there is no need for the FFI_DECLARE macros.
Since the public API is relatively small and fixed
a .def file will do the trick.

However they might get extended for GCC4
with visibility("default"), axing FFI_HIDDEN
and using -fvisibility=hidden at compile time.
In that only FFI_DECLARE definitions would make
the public API.

http://gcc.gnu.org/wiki/Visibility

IMHO it's better to maintain the public API then
hiding the remaining.


Regards
-- 
^TM



More information about the Libffi-discuss mailing list