Eo define class: Don't force EWAPI for class_get().
authorTom Hacohen <tom@stosb.com>
Tue, 3 May 2016 08:53:43 +0000 (09:53 +0100)
committerTom Hacohen <tom@stosb.com>
Tue, 3 May 2016 08:53:45 +0000 (09:53 +0100)
commit9fca3f7a147287b30482d4f7923b891bade2128f
tree449116663d4e962fd756029c3072c36c2d5c3668
parent2e68debe7b6853dff2d58e1fa89ba7939708871f
Eo define class: Don't force EWAPI for class_get().

Because we were forcing EWAPI in this macro, one couldn't create a class
that is "static" or even just private or the module. The symbol was
always exposed.
Since in C the attributes of a function are set based on the first
declaration, we don't need to specify any attributes in this macro and
we can just rely on them being specified in the declaration. So for
example, for class "foo":

foo.h:
EWAPI const Eo_Class *foo_class_get(...);

foo.c:
const Eo_Class *foo_class_get(...);

Would give the desired results, a class would be EWAPI. This is already
done automatically for all of the classes using Eolian. Because of the
lack of specifiers, the default visibility will now be the default
visibility based on compiler flags and settings.

Thanks to JP for reporting this issue.

This can potentially (but very unlikely) break things.
src/lib/eo/Eo.h