Page MenuHomePhabricator

Remove individual class BETA guards

Authored by segfaultxavi on Feb 13 2019, 2:59 AM.



Eolian adds a per-class BETA guard (like EFL_UI_WIN_BETA) to any method tagged
as @beta. This means that any app (and the EFL code) wanting to use BETA features
has to enable them class by class, which is cumbersome.
This commit replaces the individual guards with the global EFL_BETA_API_SUPPORT
guard, so apps only need to define one symbol to access BETA features.

Any usage of the per-class guards has been removed from the EFL code and examples.
When building EFL the global guard is defined by configure, so all EFL methods
already have access to BETA API.
Efl_Core.h and Efl_Ui.h no longer define EFL_BETA_API_SUPPORT. Apps wanting to
use BETA API have to define this symbol before including any EFL header
(It has been added to the examples requiring it).

Test Plan

make && make check && make examples still work, but there's a lot less #defines
in the code

Diff Detail

rEFL core/efl
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
segfaultxavi created this revision.Feb 13 2019, 2:59 AM
segfaultxavi requested review of this revision.Feb 13 2019, 2:59 AM

Added comment after \#endif for clarity

bu5hm4n requested changes to this revision.Feb 13 2019, 4:05 AM
bu5hm4n added a reviewer: q66.

Everything looks perfectly, just this tiny little thing :)

13 ↗(On Diff #19346)

This is a little problem, including Efl_Ui.h now itself does not work, because Eo.h and Efl.h are needing those defines ... What are we going to do about htat ?

This revision now requires changes to proceed.Feb 13 2019, 4:07 AM
segfaultxavi planned changes to this revision.Feb 13 2019, 4:20 AM
segfaultxavi added inline comments.
13 ↗(On Diff #19346)

You are right, I wanted the compiler to error out on unauthorized use of BETA API if you do not define that symbol, not to crash and burn on the EFL includes. Will fix.

q66 accepted this revision.Feb 13 2019, 4:34 AM

Other than what @bu5hm4n pointed out, looks fine to me. So fix that and then @bu5hm4n can accept the rev and we can land it.

Further more, eolian-tests are not passing anymore after this patch ... :)

This revision fixes the tests, but not the build breakage for apps not defining EFL_BETA_API_SUPPORT.
That is still pending.

segfaultxavi planned changes to this revision.Feb 13 2019, 8:41 AM

Do not stop defining EFL_BETA_API_SUPPORT in Efl_Core.h and Efl_Ui.h
This means not much changes, but at least the individual BETA guards disappear.

q66 accepted this revision.Feb 13 2019, 9:07 AM
This revision was not accepted when it landed; it landed in state Needs Review.Feb 13 2019, 9:09 AM
This revision was automatically updated to reflect the committed changes.